The token used for authentication with the Discord API.
The ID of the guild from which the role will be removed.
The ID of the user from whom the role will be removed.
The ID of the role to be removed.
A promise that resolves to void when the role is successfully removed.
Will throw an error if there is a problem removing the role.
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
Removes a role from a user within a specific guild.