Actions53
- Message Actions
- Channel Actions
- Thread Actions
- Reaction Actions
- Guild (Server) Actions
- Member Actions
- Role Actions
- Voice Actions
- DM Actions
- Webhook Actions
- Invite Actions
Overview
This node operation updates a role in a specified Discord guild (server). It allows modifying various attributes of a role such as its color, permissions, display settings (hoisted or mentionable), and the reason for the update which appears in the audit log. This is useful for managing role properties dynamically within a Discord server, for example, changing role colors to reflect team changes or updating permissions as server policies evolve.
Use Case Examples
- Updating the color of a role to match a new team color scheme.
- Changing role permissions to grant or restrict access to certain server features.
- Setting a role to be mentionable so members can easily tag it in messages.
Properties
| Name | Meaning |
|---|---|
| Guild ID | The ID of the Discord server (guild) where the role exists. |
| Role ID | The ID of the role to update. |
| Color | The new color of the role in hex format. |
| Additional Fields | Optional additional settings for the role update, including embed JSON, TTS flag, reason for audit log, permissions bit string, hoist (display separately), and mentionable status. |
Output
JSON
id- The ID of the updated role.name- The name of the updated role.color- The color of the updated role in integer format.position- The position of the role in the role hierarchy.
Dependencies
- Discord API
- Bot token credential
Troubleshooting
- Ensure the provided Guild ID and Role ID are correct and the bot has permissions to manage roles in the guild.
- Invalid color format errors can occur if the color is not a valid hex string.
- The bot must have the 'Manage Roles' permission in the Discord server to update roles.
- If the role is not found, verify the Role ID and that the role exists in the specified guild.
Links
- Discord.js Role Edit Documentation - Official documentation for editing roles using discord.js library.
- Discord Permissions Documentation - Details on permission bit strings used for roles in Discord.