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 interacts with the Discord API to manage Discord server (guild) members, specifically allowing the addition of roles to members. It is useful for automating role assignments in Discord servers, such as granting permissions or access to specific channels based on user roles. For example, it can be used to add a 'Moderator' role to a user when they join a server or after they complete a certain action.
Use Case Examples
- Automatically add a 'Member' role to new users joining a Discord server.
- Assign a 'VIP' role to users who purchase a subscription or meet certain criteria.
Properties
| Name | Meaning |
|---|---|
| Guild ID | The ID of the Discord server (guild) where the member exists. |
| User ID | The ID of the user (member) to whom the role will be added. |
| Role ID | The ID of the role to add to the member. |
| Additional Fields | Optional additional parameters such as reason for audit logs, embed JSON, TTS flag, and other Discord-specific settings, though not directly used for adding roles. |
Output
JSON
success- Indicates if the role was successfully added to the member.userId- The ID of the user to whom the role was added.roleId- The ID of the role that was added.added- Boolean indicating the role was added successfully.
Dependencies
- Discord API
- An API authentication token (bot token)
Troubleshooting
- Ensure the provided Guild ID, User ID, and Role ID are correct and exist in the Discord server.
- The bot must have appropriate permissions to manage roles in the guild; otherwise, the operation will fail.
- If the role ID is invalid or the user is not a member of the guild, the node will throw an error.
- Check that the bot token credential is valid and has the necessary scopes to perform member role modifications.
Links
- Discord.js GuildMember Roles - Documentation on managing roles for guild members using discord.js library.
- Discord Permissions Documentation - Official Discord documentation on permissions and roles.