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
oauth2ClientDiscordOAuth2ClientThe oauth2 client.
guildIdulongThe guild id to add the member to.
nicknamestringThe new nickname.
rolesIEnumerable<DiscordRole>The new roles.
mutedbool?Whether this user has to be muted.
deafenedbool?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
oauth2ClientDiscordOAuth2ClientThe oauth2 client.
guildDiscordGuildThe guild to add the member to.
nicknamestringThe new nickname.
rolesIEnumerable<DiscordRole>The new roles.
mutedbool?Whether this user has to be muted.
deafenedbool?Whether this user has to be deafened.
Returns
Exceptions
- NullReferenceException
Thrown when AccessToken is not present.