Discord Bot

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

Integrate the Discord Bot API with the Python API

Setup the Discord Bot API trigger to run a workflow which integrates with the Python API. Pipedream's integration platform allows you to integrate Discord Bot and Python remarkably fast. Free for developers.

Run Python Code with Python API on New Message in Channel from Discord Bot API
Discord Bot + Python
Try it
Run Python Code with Python API on New Guild Member from Discord Bot API
Discord Bot + Python
Try it
New Message in Channel from the Discord Bot API

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

Try it
New Guild Member from the Discord Bot API

Emit new event for every member added to a guild

Try it
Run Python Code with the Python API

Write Python and use any of the 350k+ PyPi packages available. Refer to the Pipedream Python docs to learn more.

Try it
Add Role with the Discord Bot API

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

Try it
Create Channel Invite with the Discord Bot API

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

Try it
Create DM with the Discord Bot API

Create a new DM channel with a user. See the docs here and here

Try it
Create Guild Channel with the Discord Bot API

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

Try it

Overview of Discord Bot

The Pipedream Discord app enables you to build event-driven workflows that interact with the Discord API. When you authorize the Pipedream app's access to your guilds, you can use Pipedream workflows to perform common Discord actions, or write your own code against the Discord API.

Getting Started

To use the Discord Bot integration, you'll need to create a Discord bot and add that bot to your server(s). Watch the 4 minute video below for a short tutorial:

  1. Create a new Discord Developer Application
  2. Within your new application, create a Bot
  3. Define the permissions you'd like the bot to have access to
  4. Open the OAuth URL generator tool under the OAuth2 menu
  5. Select the bot auth scope
  6. Copy and paste the URL into a new window
  7. Accept the permissions to install the bot on your server

Not sure if you need to use the Discord or the Discord Bot integration for your workflow? Here's are the general similarities and differences:

Discord and Discord Bot actions and triggers can both:

  • Listen to events on Discord channels, guilds, etc.
  • Perform actions like sending messages, managing channels, and members

However the Discord integration will perform actions with the official Pipedream Discord bot.

Using the Discord Bot integration will use a custom bot instead, with it's own name and photo.

New Messages in Channel

Create this source here.

This event source emits events each time a new message is delivered to a Discord channel. By default, it emits an event for every message.

When you create this source, you'll be prompted to connect your Discord Bot token (press Connect Account and then New to add your token). The source will use that token to list the guilds / channels that bot has access to.

We use Discord's API to poll for new messages in this channel once a minute, by default, but you can increase this to run up to once every 15 seconds, if you'd like.

The first time this source runs, it fetches up to the last 100 messages sent to your channel and stores the ID of the last message delivered to that channel. The next time the source runs, it polls your channel for messages sent after that ID.

By default, this event source is configured to emit an event for every new message in the channel. For example, if 5 messages are sent to the channel in one minute, the source will emit 5 events, one for each message. You can set the source to batch the events the source collects and emit them as a single event by setting the Emit messages as a single event parameter to true.

Emit messages as a single event

In this example, the source would emit a single event: an array of 5 messages.

Message content is empty or missing

If you've successfully authenticated your Discord Bot to Pipedream, but the incoming message data including content, embeds and attachments are empty; then your bot needs to apply for access to this messaging data.

At the time of writing, Discord only requires bots in 100 or more servers to apply for this access.

You can request for this approval in the Discord Developer Portal.

Connect Discord Bot

import { axios } from "@pipedream/platform"
export default defineComponent({
  props: {
    discord_bot: {
      type: "app",
      app: "discord_bot",
  async run({steps, $}) {
    return await axios($, {
      url: `https://discord.com/api/users/@me`,
      headers: {
        "Authorization": `Bot ${this.discord_bot.$auth.bot_token}`,

Connect Python

def handler(pd: "pipedream"):
  # Reference data from previous steps
  # Return data for use in future steps
  return {"foo": {"test":True}}