Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save wshao12/960967d7966f0aebb40426773d09f5a6 to your computer and use it in GitHub Desktop.
Save wshao12/960967d7966f0aebb40426773d09f5a6 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