Method AddCurrentUserToGuildAsync
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
AddCurrentUserToGuildAsync(DiscordAccessToken, ulong, string?, IEnumerable<DiscordRole>?, bool?, bool?)
Adds the current 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.
This methods invokes a sub-request to GetCurrentUserAsync(DiscordAccessToken).
public Task<DiscordMember> AddCurrentUserToGuildAsync(DiscordAccessToken accessToken, ulong guildId, string? nickname = null, IEnumerable<DiscordRole>? roles = null, bool? muted = null, bool? deafened = null)
Parameters
accessTokenDiscordAccessTokenThe discord access token.
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
AddCurrentUserToGuildAsync(DiscordAccessToken, ulong, ulong, string?, IEnumerable<DiscordRole>?, bool?, bool?)
Adds the given userId 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.
This methods does not invoke a sub-request to GetCurrentUserAsync(DiscordAccessToken).
public Task<DiscordMember> AddCurrentUserToGuildAsync(DiscordAccessToken accessToken, ulong userId, ulong guildId, string? nickname = null, IEnumerable<DiscordRole>? roles = null, bool? muted = null, bool? deafened = null)
Parameters
accessTokenDiscordAccessTokenThe discord access token.
userIdulongThe user id to add.
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.