[ACTION] Discord Bot - Send Message
See original GitHub issueIs 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.
Issue Analytics
- State:
- Created 10 months ago
- Comments:8 (1 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Hassan-Abbas-SQA Take a look now!
checked actually an and a both works