Class ClientExtensions
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public static class ClientExtensions : object
Methods
| Improve this Doc View SourceAddGuildUserAsync(BaseDiscordClient, UInt64, UInt64, String, Action<AddGuildUserProperties>, RequestOptions)
Adds a user to the specified guild.
Declaration
public static Task AddGuildUserAsync(this BaseDiscordClient client, ulong guildId, ulong userId, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
Parameters
Type | Name | Description |
---|---|---|
BaseDiscordClient | client | The Discord client object. |
UInt64 | guildId | The snowflake identifier of the guild. |
UInt64 | userId | The snowflake identifier of the user. |
String | accessToken | The OAuth2 access token for the user, requested with the guilds.join scope. |
Action<AddGuildUserProperties> | func | The delegate containing the properties to be applied to the user upon being added to the guild. |
RequestOptions | options | The options to be used when sending the request. |
Returns
Type | Description |
---|---|
Task |
Remarks
This method requires you have an OAuth2 access token for the user, requested with the guilds.join scope, and that the bot have the MANAGE_INVITES permission in the guild.