Discord Advanced icon

Discord Advanced

Advanced Discord tools - Analytics, Moderation, Backup, and Automation

Overview

This node provides advanced Discord server management tools, including analytics, moderation, backup, automation, and insights. Specifically, the 'Bulk Role Assignment' operation under the 'Automation' resource allows assigning a specified role to multiple users in a Discord server (guild) by their user IDs. This is useful for automating role management tasks, such as granting roles to new members or organizing users based on activity or other criteria.

Use Case Examples

  1. Assign a 'Member' role to a list of new users after they join the server.
  2. Bulk assign a 'VIP' role to selected users based on their contribution or status.

Properties

Name Meaning
Guild ID The ID of the Discord server (guild) where the operation will be performed.
User IDs Comma-separated list of user IDs to whom the role will be assigned.
Role ID The ID of the role to assign to the specified users.
Additional Options Optional parameters to customize behavior, such as including bots, minimum messages, spam threshold, inactive days, and max limit for processing.

Output

JSON

  • guildId - The ID of the Discord server where roles were assigned.
  • roleId - The ID of the role assigned.
  • totalUsers - Total number of user IDs processed.
  • successful - Number of users successfully assigned the role.
  • failed - Number of users for whom role assignment failed.
  • results - Array of results for each user, including userId, username, success status, and error message if any.

Dependencies

  • Discord API accessed via discord.js library
  • Requires a Discord bot token credential with appropriate permissions to manage roles and fetch guild members.

Troubleshooting

  • Common issues include invalid Guild ID, Role ID, or User IDs leading to fetch or permission errors.
  • Errors may occur if the bot lacks the 'Manage Roles' permission or if the role hierarchy prevents assignment.
  • If a user ID is invalid or the user is not a member of the guild, role assignment will fail for that user.
  • The node throws errors if the channel or guild is not found or if the bot is not ready; ensure the bot token is valid and the bot is added to the guild with correct permissions.

Links

Discussion