• Removes a role from a user within a specific guild.

    Parameters

    • token: string

      The token used for authentication with the Discord API.

    • guildId: string

      The ID of the guild from which the role will be removed.

    • userId: string

      The ID of the user from whom the role will be removed.

    • roleId: string

      The ID of the role to be removed.

    Returns Promise<void>

    A promise that resolves to void when the role is successfully removed.

    Throws

    Will throw an error if there is a problem removing the role.

    Example

    const token = 'your_discord_token_here';
    const guildId = 'your_guild_id_here';
    const userId = 'your_user_id_here';
    const roleId = 'your_role_id_here';

    const run = async () => {
    try {
    await removeUserRole(token, guildId, userId, roleId);
    console.log('Role removed successfully.');
    } catch (error) {
    console.error(`Error: ${error.message}`);
    }
    }

    run();

Generated using TypeDoc