RoleCreateCommand
An event that fires when a role is created in a guild. Placeholders can be used to retrieve data from the created role.

Placeholders: 10

  1. 1.
    {id} - role id
  2. 2.
    {name} - role name
  3. 3.
    {mention} - role mention
  4. 4.
    {ishoisted} - true or false
  5. 5.
    {ismentionable} - true or false
  6. 6.
    {color} - color of created role in hex
  7. 7.
    {guildid} - guild id of where the role is created
  8. 8.
    {guildname} - guild name of where the role is created
  9. 9.
    {created} - date when the role was created
  10. 10.
    {position} - position of the role from the bottom

Example 1: The event placed in the main file.

1
bot.RoleCreateCommand({
2
name: "$getServerVar[channel]",
3
code: `
4
The role {name} was created in {guildname}
5
`
6
})
7
bot.onRoleCreate()
Copied!

Example 2: The event placed in the event handler (its own file)

bot.onRoleCreate() - Goes in the main file to be able to call the event!
1
module.exports.RoleCreateCommand = ({
2
name: "$getServerVar[channel]",
3
code: `
4
The role {name} was created in {guildname}
5
`
6
})
Copied!
Last modified 4mo ago
Copy link