Skip to content

Member

Member connects your flow to Discord through your bot to manage the people and roles of a server: see who belongs to the server and which roles each person has, look up the existing roles, create or delete a role, and give a role to a member or take it away.

Discord roles decide what each person can see and do on the server. Managing them from a flow lets you, for example, give access to the customer channels to someone who has just bought, or remove it from someone who unsubscribes.

When to use it

  • Give the customer role to a person as soon as they complete their purchase.
  • Remove the subscriber role from people who cancel their subscription.
  • Create a role for every new training group.
  • Get the list of server members and their roles for a report.
  • Delete the roles of groups that have ended.

Configuration

You need a Discord API credential with the Public Key, Application ID and Bot Token of your application, which you find in the Discord Developer Portal. To manage roles, the bot needs the manage roles permission on the server, and its role must be above the roles it assigns. To list members, turn on the bot’s Server Members Intent option in the Discord Developer Portal. See Credentials.

In Discord, servers are also called guilds: that is why the fields mention Guild ID.

FieldWhat it does
Credential (required)Your bot’s Discord API credential.
Operation (required)What the component does. See Operations.
Guild ID (required)The ID of the Discord server. You find it in the result of Get Guilds in the Channel component.
User IDOnly in Add Roles to Member and Remove Roles from Member. The person’s ID. You find it in the result of Get Guild Members.
FilterOnly in Get Guild Roles. All Roles returns all the server’s roles; By Role ID returns one. Default: All Roles.
Role IDThe role’s ID. Required in Add Roles to Member, Remove Roles from Member, Delete Roles and in Get Guild Roles with By Role ID. You find it in the result of Get Guild Roles.
Role NameOnly in Create Role. The new role’s name.
Role OptionsOnly in Create Role, optional. Discord settings for the role, such as its color (color), whether it is shown separately in the member list (hoist), whether it can be mentioned (mentionable) or its permissions (permissions).

Operations

OperationWhat it does
Get Guild MembersReturns all the members of the server.
Add Roles to MemberGives a role to a member.
Remove Roles from MemberTakes a role away from a member.
Get Guild RolesReturns the server’s roles or one role.
Create RoleCreates a new role on the server.
Delete RolesDeletes a role from the server. Discord removes it from every member who had it.

Output

The Data output returns the members or roles you worked with. Each member has their ID (id), username (username), display name (global_name), server nickname (nick), the date they joined (joined_at) and the IDs of their roles (roles). Each role has its ID (id), name, position and permissions. The operations that give, remove or delete roles return a confirmation.

If Discord rejects the operation, for example because the bot has no permissions, the result has status set to error and the reason, instead of stopping the flow.

The component can also be connected to an Agent as a tool. See Tool Mode.

Example

An academy gives access to the student channels to every person who enrolls.

  1. The enrollment reaches the flow with the student’s Discord ID.
  2. Add Member with the Add Roles to Member operation.
  3. In Guild ID, paste the academy server’s ID; in User ID, the student’s; in Role ID, the ID of the Student role.
  4. Connect the result to Message to welcome the student in the introductions channel.

Good practices

  • Get your role IDs once with Get Guild Roles and keep them to use in your flows.
  • Get Guild Members returns every member of the server. On very large servers it takes longer.
  • Channel: looks up, creates and deletes channels.
  • Message: sends and reads messages.