Discord

Send messages, manage channels, and moderate members in Discord servers.

CommunicationAPI key16 actionsAll integrations

On this page
  1. Connect
  2. Call it from a workflow
  3. Actions (16)
  4. ban_guild_member
  5. create_channel
  6. send_message_webhook
  7. add_role_to_member
  8. createGuildRole
  9. custom_api_call
  10. delete_channel
  11. deleteGuildRole
  12. find_channel
  13. list_guild_members
  14. remove_ban_from_user
  15. remove_member_from_guild
  16. remove_role_from_member
  17. rename_channel
  18. request_approval_message
  19. sendMessageWithBot
  20. Details

Connect

Auth type: API key (secret_text). Pass the provider's API key or token as the connection's credential. It is sealed at rest and only opened on the server when an action runs.

  • From your agent: integrations {action: "connect", piece, credentials, env} stores the credentials for dev, prod or all. Answers name the fields, never the values.
  • Or set the integration's project secrets with the secrets tool (SLACK_BOT_TOKEN, DISCORD_WEBHOOK_URL, TELEGRAM_BOT_TOKEN, TWILIO_ACCOUNT_SID and TWILIO_AUTH_TOKEN …): a call uses the connection, else those secrets. integrations {action: "catalog", piece} lists which ones work.
  • Try one action now with integrations {action: "call", piece, piece_action, input}. It really sends.

Call it from a workflow

step.ctx.integrations.invoke("discord", action, input) resolves with the provider's answer and rejects when Discord isn't connected or refuses. Wrap it in step.run so a retry sends once. See step.ctx. send_message_webhook runs in the platform itself; the other actions run through the integration runner, which the server's operator turns on.

Workflow
// workflows/notify.ts: call Discord when a booking is confirmed
import { on } from "@appbricx/workflows";

export const tellDiscord = on.transition("booking", "status", "confirmed", async (_event, step) => {
  // Recorded once: a retry doesn't send it twice. Rejects when Discord isn't connected.
  const output = await step.run("Discord", () =>
    step.ctx.integrations.invoke("discord", "ban_guild_member", {
      "guild_id": "<guild_id>",
      "user_id": "<user id>"
    }),
  );
  step.ctx.log("Discord answered", output);
});
Try it from your agent
{
  "name": "integrations",
  "arguments": {
    "project_id": "<project-id>",
    "action": "call",
    "piece": "discord",
    "piece_action": "ban_guild_member",
    "input": {
      "guild_id": "<guild_id>",
      "user_id": "<user id>"
    },
    "env": "dev"
  }
}
From another backend (connector proxy)
curl -X POST "$APP_ORIGIN/__appbricx/connector-proxy/discord/ban_guild_member" \
  -H "Authorization: Bearer $APP_KEY" \
  -H "content-type: application/json" \
  -d '{"props":{"guild_id":"<guild_id>","user_id":"<user id>"}}'

Actions

ban_guild_member

Ban guild member. Bans a guild member

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
user_idrequiredtextThe user id of the member
ban_reasonoptionaltextThe reason for banning the member

create_channel

Create channel. create a channel

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
namerequiredtextThe name of the new channel

send_message_webhookbuilt in

Send Message Webhook. Send a discord message via webhook

InputTypeDescription
webhook_urlrequiredtextWebhook URL
usernameoptionaltextName
contentrequiredlong textMessage
avatar_urloptionaltextThe avatar url for webhook
embedsoptionalJSONEmbeds to send along with the message
ttsoptionalbooleanRobot reads the message

add_role_to_member

Add role to member. Add Guild Member Role

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
user_idrequiredtextThe user id of the member
role_idrequiredid (picked from your account)List of roles

createGuildRole

Create guild role. Creates a new role on the specified guild

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
role_namerequiredtextThe name of the role
role_coloroptionaltextThe RGB color of the role (may be better to set manually on the server)
display_separatedoptionalbooleanWhether the role should be displayed separately in the sidebar
role_mentionableoptionalbooleanWhether the role can be mentioned by other users
creation_reasonoptionaltextThe reason for creating the role

custom_api_call

Custom API Call. Make a custom API call to a specific endpoint

InputTypeDescription
urlrequiredobject (depends on other props)url
methodrequiredone of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD"Method
headersrequiredobjectAuthorization headers are injected automatically from your connection.
queryParamsrequiredobjectQuery Parameters
body_typeoptionalone of "none" | "json" | "form_data" | "raw"Body Type
bodyoptionalobject (depends on other props)Body
response_is_binaryoptionalbooleanEnable for files like PDFs, images, etc.
failsafeoptionalbooleanNo Error on Failure
timeoutoptionalnumberTimeout (in seconds)
followRedirectsoptionalbooleanFollow redirects

delete_channel

Delete channel. delete a channel

InputTypeDescription
channel_idrequiredid (picked from your account)List of channels

deleteGuildRole

Delete guild role. Deletes the specified role from the specified guild

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
role_idrequiredid (picked from your account)List of roles
deletion_reasonoptionaltextThe reason for deleting the role

find_channel

Find channel. find a channel by name

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
namerequiredtextThe name of the channel

list_guild_members

List guild members. List Guild Members

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
shortTextrequiredtextSearch for a member

remove_ban_from_user

Remove ban from user. Removes the guild ban from a user

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
user_idrequiredtextThe ID of the user
unban_reasonoptionaltextThe reason for unbanning the user

remove_member_from_guild

Remove member from guild. Remove Guild Member

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
user_idrequiredtextThe user id of the member

remove_role_from_member

Remove role from member. Remove Guild Member Role

InputTypeDescription
guild_idrequiredid (picked from your account)List of guilds
user_idrequiredtextThe user id of the member
role_idrequiredid (picked from your account)List of roles

rename_channel

Rename channel. rename a channel

InputTypeDescription
channel_idrequiredid (picked from your account)List of channels
namerequiredtextThe new name of the channel

request_approval_message

Request Approval in a Channel. send a message to a channel asking for approval and wait for a response

InputTypeDescription
contentrequiredlong textThe message you want to send
channelrequiredid (picked from your account)List of channels

sendMessageWithBot

Send Message with Bot. Send messages via bot to any channel or thread you want, with an optional file attachment.

InputTypeDescription
channel_idrequiredid (picked from your account)List of channels
messageoptionallong textMessage content to send.
filesoptionalarrayAttachments

Details

Id
discord
Category
Communication
Tags
chat, community, gaming, voice
Package
@activepieces/piece-discord@0.4.4
Runs
send_message_webhook in the platform; the rest through the integration runner