Table of Contents

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 DiscordUser

The user to add.

accessToken string

The user's access token (OAuth2).

nickname string

The 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

Task

Exceptions

UnauthorizedException

Thrown when the client does not have the CreateInstantInvite permission.

NotFoundException

Thrown when the user or accessToken is not found.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.