Discord
Send messages, manage channels, and moderate members in Discord servers.
On this page
- Connect
- Call it from a workflow
- Actions (16)
- ban_guild_member
- create_channel
- send_message_webhook
- add_role_to_member
- createGuildRole
- custom_api_call
- delete_channel
- deleteGuildRole
- find_channel
- list_guild_members
- remove_ban_from_user
- remove_member_from_guild
- remove_role_from_member
- rename_channel
- request_approval_message
- sendMessageWithBot
- 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.
// 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);
});{
"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"
}
}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
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
user_idrequired | text | The user id of the member |
ban_reasonoptional | text | The reason for banning the member |
create_channel
Create channel. create a channel
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
namerequired | text | The name of the new channel |
send_message_webhookbuilt in
Send Message Webhook. Send a discord message via webhook
| Input | Type | Description |
|---|---|---|
webhook_urlrequired | text | Webhook URL |
usernameoptional | text | Name |
contentrequired | long text | Message |
avatar_urloptional | text | The avatar url for webhook |
embedsoptional | JSON | Embeds to send along with the message |
ttsoptional | boolean | Robot reads the message |
add_role_to_member
Add role to member. Add Guild Member Role
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
user_idrequired | text | The user id of the member |
role_idrequired | id (picked from your account) | List of roles |
createGuildRole
Create guild role. Creates a new role on the specified guild
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
role_namerequired | text | The name of the role |
role_coloroptional | text | The RGB color of the role (may be better to set manually on the server) |
display_separatedoptional | boolean | Whether the role should be displayed separately in the sidebar |
role_mentionableoptional | boolean | Whether the role can be mentioned by other users |
creation_reasonoptional | text | The reason for creating the role |
custom_api_call
Custom API Call. Make a custom API call to a specific endpoint
| Input | Type | Description |
|---|---|---|
urlrequired | object (depends on other props) | url |
methodrequired | one of "GET" | "POST" | "PATCH" | "PUT" | "DELETE" | "HEAD" | Method |
headersrequired | object | Authorization headers are injected automatically from your connection. |
queryParamsrequired | object | Query Parameters |
body_typeoptional | one of "none" | "json" | "form_data" | "raw" | Body Type |
bodyoptional | object (depends on other props) | Body |
response_is_binaryoptional | boolean | Enable for files like PDFs, images, etc. |
failsafeoptional | boolean | No Error on Failure |
timeoutoptional | number | Timeout (in seconds) |
followRedirectsoptional | boolean | Follow redirects |
delete_channel
Delete channel. delete a channel
| Input | Type | Description |
|---|---|---|
channel_idrequired | id (picked from your account) | List of channels |
deleteGuildRole
Delete guild role. Deletes the specified role from the specified guild
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
role_idrequired | id (picked from your account) | List of roles |
deletion_reasonoptional | text | The reason for deleting the role |
find_channel
Find channel. find a channel by name
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
namerequired | text | The name of the channel |
list_guild_members
List guild members. List Guild Members
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
shortTextrequired | text | Search for a member |
remove_ban_from_user
Remove ban from user. Removes the guild ban from a user
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
user_idrequired | text | The ID of the user |
unban_reasonoptional | text | The reason for unbanning the user |
remove_member_from_guild
Remove member from guild. Remove Guild Member
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
user_idrequired | text | The user id of the member |
remove_role_from_member
Remove role from member. Remove Guild Member Role
| Input | Type | Description |
|---|---|---|
guild_idrequired | id (picked from your account) | List of guilds |
user_idrequired | text | The user id of the member |
role_idrequired | id (picked from your account) | List of roles |
rename_channel
Rename channel. rename a channel
| Input | Type | Description |
|---|---|---|
channel_idrequired | id (picked from your account) | List of channels |
namerequired | text | The 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
| Input | Type | Description |
|---|---|---|
contentrequired | long text | The message you want to send |
channelrequired | id (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.
| Input | Type | Description |
|---|---|---|
channel_idrequired | id (picked from your account) | List of channels |
messageoptional | long text | Message content to send. |
filesoptional | array | Attachments |
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