$giveRole
Gives the defined role to a member of the defined guild. 4th field may be optional with a reason and will be audited.

FUNCTION USAGE

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

Properties:

roleID - The ID of the role to add the to user. userID - The ID of the user to be given the role. 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 giving 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: $giveRole[roleID] - Gives a role to the command user.
bot.Command({
name: "role",
code: `
$giveRole[27459792374634564]
:white_check_mark: | Gave the <@&27459792374634564]> role to $tag[$authorID]
`
})
Example 2: $giveRole[userID;roleID] - Gives a role to a guild member.
bot.Command({
name: "role",
code: `
$giveRole[$mentioned[1];SomeRandomRoleIDHere]
:white_check_mark: | Gave the <@&message[2]> role to $tag[$mentioned[1]]!
`
})
Example 3: $giveRole[roleID;userID;reason] - Gives a role to a guild member with audited reason.
bot.Command({
name: "role",
code: `
$giveRole[SomeRandomRoleIDHere;$mentioned[1];$messageSlice[>2]]
:white_check_mark: | Gave the <@&message[2]> role to $tag[$mentioned[1]]!
Reason: *$messageSlice[>2]*
`
})
Last modified 1yr ago
Copy link