$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.
1
bot.Command({
2
name: "role",
3
code: `
4
$giveRole[27459792374634564]
5
:white_check_mark: | Gave the <@&27459792374634564]> role to $tag[$authorID]
6
`
7
})
Copied!
Example 2: $giveRole[userID;roleID] - Gives a role to a guild member.
1
bot.Command({
2
name: "role",
3
code: `
4
$giveRole[$mentioned[1];SomeRandomRoleIDHere]
5
:white_check_mark: | Gave the <@&message[2]> role to $tag[$mentioned[1]]!
6
`
7
})
Copied!
Example 3: $giveRole[roleID;userID;reason] - Gives a role to a guild member with audited reason.
1
bot.Command({
2
name: "role",
3
code: `
4
$giveRole[SomeRandomRoleIDHere;$mentioned[1];$messageSlice[>2]]
5
:white_check_mark: | Gave the <@&message[2]> role to $tag[$mentioned[1]]!
6
Reason: *$messageSlice[>2]*
7
`
8
})
Copied!
Last modified 3mo ago
Copy link
Contents
Properties: