$hasRole
If the user has the role in the defined guild, function returns `true`. Otherwise the function return `false`.

FUNCTION USAGE

  • $hasRole[roleID]
  • $hasRole[roleID;userID]
  • $hasRole[roleID;userID;guildID]

Properties:

userID - The user being checked. roleID - The role being checked. guildID - The guild where the user and role is being checked.
Example 1: Returns true if you have the Admin role. Else, it will return false
bot.Command({
name: "check",
code: `
$hasRole[$authorID;$roleID[Admin]]
`
})

Example 2: Returns undefined if the role does not exist or is simply not a role.

bot.Command({
name: "check",
code: `
$hasRole[$authorID;$roleID[Admin]]
`
})
Last modified 1yr ago
Copy link