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
DiscordOAuth2ClientThe oauth2 client.
guildId
ulongThe guild id to add the member to.
nickname
stringThe 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
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
DiscordOAuth2ClientThe oauth2 client.
guild
DiscordGuildThe guild to add the member to.
nickname
stringThe 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
Exceptions
- NullReferenceException
Thrown when AccessToken is not present.