DEV Community

Cover image for [Discord] Send message through Bot
nicha
nicha

Posted on

3 1 1

[Discord] Send message through Bot

I am a newbie to Discord. Recently, my friend and I started a discord channel for a live talk session to interview people and share our experiences with interested people.

When sending a message, I'm thinking about a way to send a message through a bot instead of using my account, so my friend taught me a way to do that. And today, you will know it too!!



First of all, you have to be an admin of that server. Then, visit the server setting > integration > webhook.

Webhook-setting

Then, click "New Webhook" and choose the channel that you want to send message to
Create-webhook

Later on, click on the button "Copy Webhook URL" to copy the webhook URL

Lastly, you can send a message by inputting it into the curl.

curl --location --request POST '{YOUR_WEBHOOK_URL}' \
--header 'Content-Type: application/json' \
--data-raw '{
    "content": "{YOUR_MESSAGE}",
    "username": "{SENDER_NAME}",
    "avatar_url": "{PICTURE_URL}"
}
'
Enter fullscreen mode Exit fullscreen mode

Please feel free to share interesting bot and command in discord with me 👾

Image of Datadog

Create and maintain end-to-end frontend tests

Learn best practices on creating frontend tests, testing on-premise apps, integrating tests into your CI/CD pipeline, and using Datadog’s testing tunnel.

Download The Guide

Top comments (1)

Collapse
 
thomasbnt profile image
Thomas Bnt

Hello nice post about Discord and Curl!

Don't hesitate to put colors on your codeblock like this example for have to have a better understanding of your code 😎

console.log('Hello world!');
Enter fullscreen mode Exit fullscreen mode

Example of how to add colors and syntax in codeblocks

Image of Docusign

🛠️ Bring your solution into Docusign. Reach over 1.6M customers.

Docusign is now extensible. Overcome challenges with disconnected products and inaccessible data by bringing your solutions into Docusign and publishing to 1.6M customers in the App Center.

Learn more