Table of Contents

Method OAuth2AddToGuildAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

OAuth2AddToGuildAsync(DiscordOAuth2Client, ulong, string?, IEnumerable<DiscordRole>?, bool?, bool?)

Adds the user to the given guildId.

Some parameters might need additional permissions for the bot on the target guild. See https://discord.com/developers/docs/resources/guild#add-guild-member for details.

public Task<DiscordMember> OAuth2AddToGuildAsync(DiscordOAuth2Client oauth2Client, ulong guildId, string? nickname = null, IEnumerable<DiscordRole>? roles = null, bool? muted = null, bool? deafened = null)

Parameters

oauth2Client DiscordOAuth2Client

The oauth2 client.

guildId ulong

The guild id to add the member to.

nickname string

The new nickname.

roles IEnumerable<DiscordRole>

The new roles.

muted bool?

Whether this user has to be muted.

deafened bool?

Whether this user has to be deafened.

Returns

Task<DiscordMember>

Exceptions

NullReferenceException

Thrown when AccessToken is not present.

OAuth2AddToGuildAsync(DiscordOAuth2Client, DiscordGuild, string?, IEnumerable<DiscordRole>?, bool?, bool?)

Adds the user to the given guild.

Some parameters might need additional permissions for the bot on the target guild. See https://discord.com/developers/docs/resources/guild#add-guild-member for details.

public Task<DiscordMember> OAuth2AddToGuildAsync(DiscordOAuth2Client oauth2Client, DiscordGuild guild, string? nickname = null, IEnumerable<DiscordRole>? roles = null, bool? muted = null, bool? deafened = null)

Parameters

oauth2Client DiscordOAuth2Client

The oauth2 client.

guild DiscordGuild

The guild to add the member to.

nickname string

The new nickname.

roles IEnumerable<DiscordRole>

The new roles.

muted bool?

Whether this user has to be muted.

deafened bool?

Whether this user has to be deafened.

Returns

Task<DiscordMember>

Exceptions

NullReferenceException

Thrown when AccessToken is not present.