Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save DRIVER-217/62c2da36c8125f762405ed7d18faeaa7 to your computer and use it in GitHub Desktop.
Save DRIVER-217/62c2da36c8125f762405ed7d18faeaa7 to your computer and use it in GitHub Desktop.
sends a message to a discord channel via a bot using command line HTTP POST- curl
#!/bin/bash
# update the TOKEN and the CHANNELID, rest is optional
# you may need to connect with a websocket the first time you run the bot
# use a library like discord.py to do so
curl -v \
-H "Authorization: Bot TOKEN" \
-H "User-Agent: myBotThing (http://some.url, v0.1)" \
-H "Content-Type: application/json" \
-X POST \
-d '{"content":"Posting as a bot"}' \
https://discordapp.com/api/channels/CHANNELID/messages
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment