Forked from ianklatzco/discord-bot-post-message.sh
Last active
March 1, 2018 14:36
-
-
Save maxpatternman/072e20ea06d3a095ecd37f05a2803ac3 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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env 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 | |
BOT_TOKEN='' | |
CHANNELID='' | |
curl -v \ | |
-H "Authorization: ${BOT_TOKEN}" \ | |
-H "User-Agent: myBotThing (http://some.url, v0.1)" \ | |
-H "Content-Type: application/json" \ | |
-X POST \ | |
-d "{\"content\":\"${1}\"}" \ | |
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