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
accessToken
DiscordAccessTokenThe discord access token.
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
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
accessToken
DiscordAccessTokenThe discord access token.
userId
ulongThe user id to add.
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.