Aller au contenu
Version: v1.2
Sur cette page

roleSetup

Ce contenu n’est pas encore disponible dans votre langue.

This class provides methods to manage the level roles of a guild: the roles users are given when they reach a level.

Adds a role to the role setup.

Parameter Type Required Description
client Client ✅ The Discord client.
guildId string ✅ The guild ID of the role setup.
options LevelAddOptions ✅ The options for the role setup.
  • Promise<true> - If the role was added.
  • new Error() - If the role is not a role of the guild (Role ID is invalid), or that level and role were already added (Level Already Exist. Use delete).

Finds a role in the role setup.

Parameter Type Required Description
client Client ✅ The Discord client.
guildId string ✅ The guild ID of the role setup.
level string ✅ The level of the role setup.
  • Promise<{ lvl: string, role: string } | undefined> - The first entry set for that level, or undefined.

Lists all level roles in a guild.

Parameter Type Required Description
client Client ✅ The Discord client.
guildId string ✅ The guild ID of the role setup.
  • Promise<{ lvl: string, role: string }[] | undefined> - Every entry, or undefined if the guild has no level roles.

Removes the roles set for a level.

Parameter Type Required Description
client Client ✅ The Discord client.
guildId string ✅ The guild ID of the role setup.
options LevelRemoveOptions ✅ The options for the role setup.
  • Promise<true> - If the roles were removed.
  • new Error() - If no role is set for that level (Level role with this level does not exist).

Options Type Required Description
level string ✅ Level to add the role to.
role Role ID ✅ ID of the role to add.
Options Type Required Description
level string ✅ Level to remove the roles from.