Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Last active June 27, 2022 08:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ruanbekker/dd948c054b6648945104f9a74e9b499a to your computer and use it in GitHub Desktop.
Save ruanbekker/dd948c054b6648945104f9a74e9b499a to your computer and use it in GitHub Desktop.
Send messages to Discord using curl

This blog post shows how to create a token:

Enable developer mode:

  1. User Settings
  2. Advanced
  3. Enable Developer Mode

Get the channel id:

  1. Right click on a channel
  2. Select "copy id"

Make a request:

curl -H "Authorization: Bot $DISCORD_TOKEN" \
     -H "Content-Type: application/json" \
     -XPOST "https://discordapp.com/api/channels/$CHANNEL_ID/messages" -d '{"content": "hi"}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment