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
userDiscordUserThe user to add.
accessTokenstringThe user's access token (OAuth2).
nicknamestringThe new nickname.
rolesIEnumerable<DiscordRole>The new roles.
mutedbool?Whether this user has to be muted.
deafbool?Whether this user has to be deafened.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the CreateInstantInvite permission.
- NotFoundException
Thrown when the
useroraccessTokenis not found.- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.