Skip to content

Member

The Member component allows you to interact with users on a Discord server. You can use it to find specific users, check their details, or manage their information within your automation workflows. It acts as a bridge between Nappai and Discord, enabling you to perform actions based on server roles or user identities.

How it Works

This component connects securely to the Discord API. When you configure it with a server ID and optional user or role details, it sends requests to Discord to fetch or manage member data. The component handles the communication process and returns structured data that you can use in subsequent steps of your workflow.

Connection & Credentials

This component requires configuring a credential in the Nappai panel before interacting with the external service:

  1. Go to the Credentials section in your Nappai panel.
  2. Create a new credential of the type Discord API and fill in the required fields (Public Key, Application ID, Bot Token). You can find these details in the Discord Developer Portal under your application’s Bot section.
  3. In your workflow, select the saved credential in the Credential input field of this node.

Inputs

Mapping Mode

This component has a special mode called “Mapping Mode”. When you enable this mode using the toggle switch, an additional input called “Mapping Data” is activated, and each input field offers you three different ways to provide data:

  • Fixed: You type the value directly into the field.
  • Mapped: You connect the output of another component to use its result as the value.
  • Javascript: You write Javascript code to dynamically calculate the value.

This flexibility allows you to create more dynamic and connected workflows.

Input Fields

  • Operation: Select the type of action you want to perform with Discord members.
  • Guild ID: The unique ID of the Discord server where you want to interact with members.
  • User ID: The unique ID of a specific user to retrieve or manage.
  • Filter: Choose whether to retrieve all roles or filter results by a specific Role ID.
  • Role ID: The unique ID of a role associated with the server or user.
  • Role Name: The display name of the role to search for or create.
  • Role Options: A structured input for advanced role configurations, such as color, permissions, or hoist settings. Maps directly to Discord’s Create Guild Role API fields.
  • Top: The maximum number of guild members to retrieve in the results.

Outputs

Output Data Example

The component returns Data containing information about the Discord members or the result of the action performed. json { “id”: “987654321098765432”, “username”: “GuildMember”, “avatar”: “a_abcdef1234567890”, “discriminator”: “1234”, “global_name”: “Member Name”, “roles”: [“RoleID1”, “RoleID2”], “joined_at”: “2024-01-15T10:30:00.000000+00:00”, “pending”: false, “flags”: 0 }

Connectivity

This component is typically used to retrieve information about Discord users or roles. The Data output can be connected to downstream components to perform further actions, such as sending messages to specific users, updating database records with member details, or filtering user lists for further processing. It serves as a reliable source of user information for automation workflows involving Discord communities.

Usage Example

Retrieving User Details: You can use this component to get information about a specific user in your Discord server. Enter the Guild ID of your server and the User ID of the person you want to look up. The component will return the user’s profile data, which you can then use to send personalized messages or update your internal records.

Tips and Best Practices

  • Always verify the Guild ID matches the server you intend to manage to avoid errors.
  • Use the Filter option combined with Role ID or Role Name to target specific groups of members efficiently.
  • Adjust the Top parameter when retrieving large lists of members to control the amount of data returned.
  • Ensure your Discord bot has the necessary permissions in the server to access member information and roles.

Security Considerations

Keep your Discord API credentials secure. Never share your Bot Token or Application ID in public places or hardcode them in your workflow scripts. Use the Nappai credential manager to safely store and inject authentication details. Ensure the bot account has appropriate permissions within your Discord server to perform the desired actions without exposing sensitive data.