Skip to content

Instantly share code, notes, and snippets.

@ruanbekker
Last active July 5, 2024 02:11
Show Gist options
  • 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