🎉 Pipedream raises $20M Series A 🎉
Read the blog post and TC Techcrunch article.
← Discord Bot

Delete message with Discord Bot API

Pipedream makes it easy to connect APIs for Discord Bot and 700+ other apps remarkably fast.

Trigger workflow on
HTTP requests, schedules and app events
Next, do this
Delete message with the Discord Bot API
No credit card required
Trusted by 250,000+ developers from startups to Fortune 500 companies:
Trusted by 250,000+ developers from startups to Fortune 500 companies

Developers Pipedream

Getting Started

Create a workflow to Delete message with the Discord Bot API. When you configure and deploy the workflow, it will run on Pipedream's servers 24x7 for free.

  1. Configure the Delete message action
    1. Connect your Discord Bot account
    2. Select a Guild
    3. Select a Channel
    4. Select a Message
  2. Select a trigger to run your workflow on HTTP requests, schedules or app events
  3. Deploy the workflow
  4. Send a test event to validate your setup
  5. Turn on the trigger

Details

This is a pre-built, open source component from Pipedream's GitHub repo. The component is developed by Pipedream and the community, and verified and maintained by Pipedream.

To contribute an update to an existing component or create a new component, create a PR on GitHub. If you're new to Pipedream component development, you can start with quickstarts for trigger span and action development, and then review the component API reference.

Delete message on Discord Bot
Description:Delete a message. [See the docs here](https://discord.com/developers/docs/resources/channel#delete-message)
Version:0.0.1
Key:discord_bot-delete-message

Code

import common from "../common.mjs";

const { discord } = common.props;

export default {
  ...common,
  key: "discord_bot-delete-message",
  name: "Delete message",
  description: "Delete a message. [See the docs here](https://discord.com/developers/docs/resources/channel#delete-message)",
  type: "action",
  version: "0.0.1",
  props: {
    ...common.props,
    messageId: {
      propDefinition: [
        discord,
        "channelMessage",
        ({ channelId }) => ({
          channelId,
        }),
      ],
    },
  },
  async run({ $ }) {
    const response = await this.discord.deleteChannelMessage({
      $,
      channelId: this.channelId,
      messageId: this.messageId,
    });

    if (!response) {
      return {
        id: this.messageId,
        success: true,
      };
    }

    return response;
  },
};

Configuration

This component may be configured based on the props defined in the component code. Pipedream automatically prompts for input values in the UI and CLI.
LabelPropTypeDescription
Discord BotdiscordappThis component uses the Discord Bot app.
GuildguildIdstringSelect a value from the drop down menu.
ChannelchannelIdstringSelect a value from the drop down menu.
MessagemessageIdstringSelect a value from the drop down menu.

Authentication

Discord Bot uses API keys for authentication. When you connect your Discord Bot account, Pipedream securely stores the keys so you can easily authenticate to Discord Bot APIs in both code and no-code steps.

If you haven't created a Discord bot, see these instructions or watch this video. You'll need to add this bot to your server(s).

Once you've created your bot, you'll find the Bot token within the Bot section of your app.

About Discord Bot

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

About Pipedream

Stop writing boilerplate code, struggling with authentication and managing infrastructure. Start connecting APIs with code-level control when you need it — and no code when you don't.

Into to Pipedream
Watch us build a workflow
Watch us build a workflow
7 min
Watch now ➜
"The past few weeks, I truly feel like the clichéd 10x engineer."
@heyellieday