Class ClientExtensions
Inheritance
System.Object
ClientExtensions
Inherited Members
System.Object.ToString()
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: Discord.Rest
Assembly: Discord.Net.Rest.dll
Syntax
public static class ClientExtensions
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. |
| System.UInt64 | guildId | The snowflake identifier of the guild. |
| System.UInt64 | userId | The snowflake identifier of the user. |
| System.String | accessToken | The OAuth2 access token for the user, requested with the guilds.join scope. |
| System.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 |
|---|---|
| System.Threading.Tasks.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.