question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[ACTION] Discord Bot - Send Message

See original GitHub issue

Is there a specific app this action is for?

Discord Bot

Please provide a link to the relevant API docs for the specific service / operation.

https://discord.com/developers/docs/resources/channel#create-message

It should follow the same props as the exisiting Discord - Send Message action, but for a Discord Bot.

Example scaffolding:

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/channels/1009837570840068128/messages`,
      method: "POST",
      headers: {
        "Authorization": `Bot ${this.discord_bot.$auth.bot_token}`,
      },
      data: {
  "content": "this `supports` __a__ **subset** *of* ~~markdown~~ 😃 ```js\nfunction foo(bar) {\n  console.log(bar);\n}\n\nfoo(1);```",
  "embed": {
    "title": "title ~~(did you know you can have markdown here too?)~~",
    "description": "this supports [named links](https://discordapp.com) on top of the previously shown subset of markdown. ```\nyes, even code blocks```",
    "url": "https://discordapp.com",
    "color": 1841563,
    "timestamp": "2022-12-02T16:03:36.315Z",
    "footer": {
      "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png",
      "text": "footer text"
    },
    "thumbnail": {
      "url": "https://cdn.discordapp.com/embed/avatars/0.png"
    },
    "image": {
      "url": "https://cdn.discordapp.com/embed/avatars/0.png"
    },
    "author": {
      "name": "author name",
      "url": "https://discordapp.com",
      "icon_url": "https://cdn.discordapp.com/embed/avatars/0.png"
    },
    "fields": [
      {
        "name": "🤔",
        "value": "some of these properties have certain limits..."
      },
      {
        "name": "😱",
        "value": "try exceeding some of them!"
      },
      {
        "name": "🙄",
        "value": "an informative error should show up, and this view will remain as-is until all issues are fixed"
      },
      {
        "name": "<:thonkang:219069250692841473>",
        "value": "these last two",
        "inline": true
      },
      {
        "name": "<:thonkang:219069250692841473>",
        "value": "are inline fields",
        "inline": true
      }
    ]
  }
}
    })
  },
})

Additionally, please return the response so the message ID can be used in future steps for editing, deleting, etc. CleanShot 2022-12-02 at 11 12 13@2x

Issue Analytics

  • State:closed
  • Created 10 months ago
  • Comments:8 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
lcaresiacommented, Dec 8, 2022

@Hassan-Abbas-SQA Take a look now!

0reactions
Hassan-Abbas-SQAcommented, Dec 13, 2022

@Hassan-Abbas-SQA Correct is use an before a vowel sound, no?

checked actually an and a both works

Read more comments on GitHub >

github_iconTop Results From Across the Web

Send a message with Discord.js - Stack Overflow
If you have a message object, such as in a message event handler, you can send a message to the channel of the...
Read more >
How to Make a Discord Bot: An Overview and Tutorial - Toptal
The Discord REST API is used by bots to perform most actions, such as sending messages, kicking/banning users, and updating user permissions (broadly ......
Read more >
4 Best Discord Bots That Can Sends Timed Messages
1. Message Scheduler. As the name implies, this bot was developed for sending timed and repeating messages. It is a feature-rich bot with...
Read more >
Send Message (Advanced) with Discord Webhook API on ...
This integration creates a workflow with a Discord Bot trigger and Discord Webhook action. When you configure and deploy the workflow, it will...
Read more >
Message Components - Developer Portal - Discord
Message components—we'll call them "components" moving forward—are a framework for adding interactive elements to the messages your app or bot sends.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found