$takeRole
Removes the defined role from a member of the defined guild. 4th field sets a reason and will be audited.

FUNCTION USAGE

  • $takeRole[roleID]
  • $takeRole[roleID;userID]
  • $takeRole[roleID;userID;guildID]
  • $takeRole[roleID;userID;guildID;reason]

Properties:

roleID - The ID of the role to remove from the user. userID - The ID of the user to remove the role from. Defaults to command author. guildID - The ID of the guild where the user and role is located. Defaults to current guild. reason - The reason for removing the role. Audits the reason. May be optional.
The bot must have manage roles permissions and a role above given user's highest role.
Example 1: $takeRole[roleID] - Removes a role from the command user.
bot.Command({
name: "role-remove",
code: `
$takeRole[27459792374634564]
:white_check_mark: | Removed the <@&27459792374634564]> role from $tag[$authorID]
`
})
Example 2: $takeRole[roleID;userID] - Removes a role from a guild member.
bot.Command({
name: "role-remove",
code: `
$takeRole[SomeRandomRoleIDHere;$mentioned[1]]
:white_check_mark: | Removed <@&message[2]> role from $tag[$mentioned[1]]!
`
})
Example 3: $takeRole[roleID;userID;reason] - Removes a role from a guild member with audited reason.
bot.Command({
name: "role-remove",
code: `
$takeRole[SomeRandomRoleIDHere;$mentioned[1];$messageSlice[>2]]
:white_check_mark: | Removed <@&message[2]> role from $tag[$mentioned[1]]!
Reason: *$messageSlice[>2]*
`
})
Last modified 1yr ago
Copy link