bot.onRoleCreate
An event that gets executed, if the bot sees a role creation in guilds. To let the bot listen to the event, add one bot.onRoleCreate() callback inside your mainfile.
This callback triggers every time a role gets created in a server.

Usage:

1
bot.roleCreateCommand({ //Command
2
channel: "channel ID", //Channel where its being logged
3
code: `your code` //Code sent to <channel>
4
})
Copied!

Example Command:

1
bot.roleCreateCommand({
2
channel: "772414449839636490",
3
code: `
4
Role Created:
5
$newRole[name]
6
`
7
})
Copied!

Options:

You can use these functions $newRole[] with the options below to return new role data:
  • id => The ID of the role
  • name "The name of the role
  • position => The position of this role
  • rawPosition => The position of this role given by the API
  • hexColor => The hex color for this role
  • color => The color of this role
  • hoist => Whether the role is hoisted or not
  • mentionable => Whether the role is mentionable or not
  • guildID => The ID of the guild the role belongs to
  • editable => Whether the role is editable by the client or not
  • managed: => Whether this role is managed by discord or not (bot- & booster-roles)
  • deleted: => Whether the role was deleted or not
  • permissions => The permissions for this role
Last modified 1mo ago
Copy link
Edit on GitHub