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). Paste the API key (or token) from the provider's settings into the connect dialog. It is encrypted at rest and only decrypted on the server when an action runs.
- In the editor: Backend panel, Integrations tab, then Connect. This connects it for the project.
- For every project in a workspace: Workspace settings, Integrations.
- Owners and admins choose which integrations members may connect in the admin panel (Integrations tab), and can attach their own OAuth app there.
Call it from a workflow
Pass the action name and its input. The call resolves with { success, output, error? }; a missing connection resolves with success false and the reason. See ctx.integrations.invoke and ctx.integrations.call.
// .workflow.js (native ctx)
export async function run(ctx) {
const res = await ctx.integrations.invoke("discord", "ban_guild_member", {
"guild_id": "<guild_id>",
"user_id": "<user id>"
});
if (!res.success) throw new Error(res.error);
ctx.log.info("Discord answered", { output: res.output });
}// defineWorkflow module (@app/sdk ctx)
import { defineWorkflow } from "@app/sdk";
export default defineWorkflow({
id: "discord-ban-guild-member",
name: "Discord: Ban guild member",
description: "Calls Discord when a row is created.",
trigger: { type: "entity_event", entity: "tickets", event: "created" },
async run(ctx, event) {
const res = await ctx.integrations.call("discord", {
"action": "ban_guild_member",
"guild_id": "<guild_id>",
"user_id": "<user id>"
}) as { success: boolean; error?: string };
if (!res.success) throw new Error(res.error);
},
});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_memberin catalog
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_channelin catalog
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_webhookin catalog
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- Tier
- Built in