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.
Revisions
-
maxpatternman revised this gist
Mar 1, 2018 . 1 changed file with 8 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,13 +1,16 @@ #!/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 -
ianklatzco created this gist
Dec 29, 2016 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,13 @@ #!/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