Skip to content
Interfaceplugin-oauthv0.1.0

UserCalls

Discord calls made as one user.

Each typed method needs one scope. With that scope in the client's scopes, it resolves to the result. With it in extraScopes, it resolves to undefined for a user who hasn't granted it yet. With it in neither, the call doesn't compile.

get, post, put, patch, and delete reach every other route and don't check scopes.

interface UserCalls<
    TScopes extends OAuthScope = never,
    TExtra extends OAuthScope = never
> extends UserRest

joinGuild()

Adds the user to a server that the bot is in. Needs the guilds.join scope, and the bot needs the Create Invite permission there.

joinGuild(
    args: ScopedArgs<
        TScopes | TExtra,
        "guilds.join",
        [guildId: string, options?: GuildJoinOptions]
    >
): ScopedResult<TScopes, "guilds.join", GuildJoin>