Search Results for

    Show / Hide Table of Contents

    Class ClientExtensions

    Inheritance
    Object
    ClientExtensions
    Namespace: Discord.Rest
    Assembly: Discord.Net.Rest.dll
    Syntax
    public static class ClientExtensions : object

    Methods

    | Improve this Doc View Source

    AddGuildUserAsync(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.

    Theme

    • Improve this Doc
    • View Source
    In This Article
    Back to top Discord.Net (c) 2015-2022 3.6.0