# Discord Bot — Pipedream Connect

> Use this app to interact with the Discord API using a bot in your account

- API slug: `discord_bot` (use in MCP headers and tool keys)
- Auth: API key (Pipedream-managed)
- Categories: Communication
- Website: https://discord.com/
- This page (HTML): https://pipedream.com/apps/discord-bot
- Tools: 22 actions · 5 triggers

## Connect via MCP (recommended)

- Endpoint: `https://remote.mcp.pipedream.net/v3`
- Headers: `Authorization: Bearer <token>` · `x-pd-project-id` · `x-pd-environment` · `x-pd-external-user-id` · `x-pd-app-slug: discord_bot`

```ts
import { Client } from "@modelcontextprotocol/sdk/client/index.js"
import { StreamableHTTPClientTransport } from "@modelcontextprotocol/sdk/client/streamableHttp.js"
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const accessToken = await pd.rawAccessToken

const transport = new StreamableHTTPClientTransport(
  new URL("https://remote.mcp.pipedream.net/v3"),
  {
    requestInit: {
      headers: {
        Authorization: `Bearer ${accessToken}`,
        "x-pd-project-id": process.env.PIPEDREAM_PROJECT_ID!,
        "x-pd-environment": "production",
        "x-pd-external-user-id": "{external_user_id}", // any stable ID for this user in your system
        "x-pd-app-slug": "discord_bot",
      },
    },
  },
)

const mcp = new Client({ name: "my-agent", version: "1.0.0" })
await mcp.connect(transport)

const { tools } = await mcp.listTools()

// e.g. run Add Role:
const result = await mcp.callTool({
  name: "discord_bot-add-role",
  arguments: {
    guildId: "Guild",
    userId: "User",
  },
})
```

Docs: [MCP guide](https://pipedream.com/docs/connect/mcp/developers.md)

## API proxy

For a Discord Bot endpoint with no pre-built tool, the proxy forwards your request with the connected user's credentials attached.

```bash
# The path segment is the target URL, URL-safe base64 encoded:
# https://discord.com/api/users/@me

curl "https://api.pipedream.com/v1/connect/{project_id}/proxy/aHR0cHM6Ly9kaXNjb3JkLmNvbS9hcGkvdXNlcnMvQG1l?external_user_id={external_user_id}&account_id=apn_xxxxxxx" \
  -H "Authorization: Bearer {access_token}" \
  -H "x-pd-environment: production"
```

Docs: [API proxy guide](https://pipedream.com/docs/connect/api-proxy.md)

## SDK

```ts
import { PipedreamClient } from "@pipedream/sdk"

const pd = new PipedreamClient({
  projectId: process.env.PIPEDREAM_PROJECT_ID!,
  clientId: process.env.PIPEDREAM_CLIENT_ID!,
  clientSecret: process.env.PIPEDREAM_CLIENT_SECRET!,
  projectEnvironment: "production",
})

const result = await pd.actions.run({
  id: "discord_bot-add-role",
  externalUserId: "{external_user_id}", // any stable ID for this user in your system
  configuredProps: {
    discord_bot: { authProvisionId: "apn_xxxxxxx" },
    guildId: "Guild",
    userId: "User",
  },
})
```

Docs: [Managed auth guide](https://pipedream.com/docs/connect/managed-auth/quickstart.md) · [Tools guide](https://pipedream.com/docs/connect/components.md)

## Actions (22)

### `discord_bot-add-role` — Add Role (Write)

Assign a role to a user. Remember that your bot requires the MANAGE_ROLES permission. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/add-role.md

### `discord_bot-change-nickname` — Change Nickname (Write)

Modifies the nickname of the current user in a guild.

Full schema: https://pipedream.com/apps/discord-bot/actions/change-nickname.md

### `discord_bot-create-channel-invite` — Create Channel Invite (Write)

Create a new invite for the channel. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/create-channel-invite.md

### `discord_bot-create-guild-channel` — Create Guild Channel (Write)

Create a new channel for the guild. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/create-guild-channel.md

### `discord_bot-delete-channel` — Delete Channel (Write)

Delete a Channel.

Full schema: https://pipedream.com/apps/discord-bot/actions/delete-channel.md

### `discord_bot-delete-message` — Delete message (Write)

Delete a message. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/delete-message.md

### `discord_bot-find-channel` — Find Channel (Read-only)

Find an existing channel by name. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/find-channel.md

### `discord_bot-find-user` — Find User (Read-only)

Find an existing user by name. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/find-user.md

### `discord_bot-get-message` — Get message (Write)

Return a specific message in a channel. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/get-message.md

### `discord_bot-list-channel-invites` — List Channel Invites (Read-only)

Return a list of invitees for the channel. Only usable for guild channels.

Full schema: https://pipedream.com/apps/discord-bot/actions/list-channel-invites.md

### `discord_bot-list-channel-messages` — List Channel Messages (Read-only)

Return the messages for a channel. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/list-channel-messages.md

### `discord_bot-list-channels` — List Channels (Read-only)

Return a list of channels. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/list-channels.md

### `discord_bot-list-guild-members` — List Guild Members (Read-only)

Return a list of guild members. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/list-guild-members.md

### `discord_bot-list-users-with-emoji-reactions` — List Users that Reacted with Emoji (Read-only)

Return a list of users that reacted with a specified emoji.

Full schema: https://pipedream.com/apps/discord-bot/actions/list-users-with-emoji-reactions.md

### `discord_bot-modify-channel` — Modify Channel (Write)

Update a channel's settings. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/modify-channel.md

### `discord_bot-modify-guild-member` — Modify Guild Member (Write)

Update attributes of a guild member. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/modify-guild-member.md

### `discord_bot-post-reaction-with-emoji` — Post Reaction with Emoji (Write)

Post a reaction for a message with an emoji. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/post-reaction-with-emoji.md

### `discord_bot-remove-user-role` — Remove User Role (Write)

Remove a selected role from the specified user. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/remove-user-role.md

### `discord_bot-rename-channel` — Rename Channel (Write)

Rename a channel to a specified name you choose

Full schema: https://pipedream.com/apps/discord-bot/actions/rename-channel.md

### `discord_bot-send-message` — Send message (Write)

Send message to a user or a channel. See the docs here and here

Full schema: https://pipedream.com/apps/discord-bot/actions/send-message.md

### `discord_bot-send-message-to-forum-post` — Send Message to Forum Post (Write)

Send a message to a Discord forum. See the documentation

Full schema: https://pipedream.com/apps/discord-bot/actions/send-message-to-forum-post.md

### `discord_bot-send-message-with-file` — Send Message With File (Write)

Post a message with an attached file. See the docs here

Full schema: https://pipedream.com/apps/discord-bot/actions/send-message-with-file.md

## Triggers (5)

### `discord_bot-new-message-in-channel` — New Message in Channel (Polling)

Emit new event for each message posted to one or more channels

Full schema: https://pipedream.com/apps/discord-bot/triggers/new-message-in-channel.md

### `discord_bot-new-forum-thread-message` — New Forum Thread Message (Polling)

Emit new event for each forum thread message posted. Note that your bot must have the MESSAGE_CONTENT privilege intent to see the message content. See the documentation.

Full schema: https://pipedream.com/apps/discord-bot/triggers/new-forum-thread-message.md

### `discord_bot-new-guild-member` — New Guild Member (Polling)

Emit new event for every member added to a guild. See docs here

Full schema: https://pipedream.com/apps/discord-bot/triggers/new-guild-member.md

### `discord_bot-new-tag-added-to-thread` — New Tag Added to Forum Thread (Polling)

Emit new event when a new tag is added to a thread

Full schema: https://pipedream.com/apps/discord-bot/triggers/new-tag-added-to-thread.md

### `discord_bot-new-thread-message` — New Thread Message (Polling)

Emit new event for each thread message posted.

Full schema: https://pipedream.com/apps/discord-bot/triggers/new-thread-message.md

---

- All apps: https://pipedream.com/apps — index: https://pipedream.com/llms.txt
- Pipedream docs for agents: https://pipedream.com/docs/llms.txt
