Method AddMemberAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
AddMemberAsync(DiscordUser, string, string?, IEnumerable<DiscordRole>?, bool?, bool?)
Adds a new member to this guild
public Task AddMemberAsync(DiscordUser user, string accessToken, string? nickname = null, IEnumerable<DiscordRole>? roles = null, bool? muted = null, bool? deaf = null)
Parameters
user
DiscordUserThe user to add.
accessToken
stringThe user's access token (OAuth2).
nickname
stringThe new nickname.
roles
IEnumerable<DiscordRole>The new roles.
muted
bool?Whether this user has to be muted.
deaf
bool?Whether this user has to be deafened.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the CreateInstantInvite permission.
- NotFoundException
Thrown when the
user
oraccessToken
is not found.- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.