You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

ClientExtensions.cs 1.3 kB

1234567891011121314151617181920212223
  1. using System;
  2. using System.Threading.Tasks;
  3. namespace Discord.Rest.Extensions
  4. {
  5. public static class ClientExtensions
  6. {
  7. /// <summary>
  8. /// Adds a user to the specified guild.
  9. /// </summary>
  10. /// <remarks>
  11. /// 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.
  12. /// </remarks>
  13. /// <param name="client">The Discord client object.</param>
  14. /// <param name="guildId">The snowflake identifier of the guild.</param>
  15. /// <param name="userId">The snowflake identifier of the user.</param>
  16. /// <param name="accessToken">The OAuth2 access token for the user, requested with the guilds.join scope.</param>
  17. /// <param name="func">The delegate containing the properties to be applied to the user upon being added to the guild.</param>
  18. /// <param name="options">The options to be used when sending the request.</param>
  19. public static Task AddGuildUserAsync(this BaseDiscordClient client, ulong guildId, ulong userId, string accessToken, Action<AddGuildUserProperties> func = null, RequestOptions options = null)
  20. => GuildHelper.AddGuildUserAsync(guildId, client, userId, accessToken, func, options);
  21. }
  22. }