Table of Contents

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 DiscordAccessToken

The discord access token.

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>

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 DiscordAccessToken

The discord access token.

userId ulong

The user id to add.

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>