X-Git-Url: https://git.josue.xyz/?p=dotfiles%2F.git;a=blobdiff_plain;f=.local%2Fbin%2Fposter;fp=.local%2Fbin%2Fposter;h=c99391b2fde8767db0f6b4831d44c1971d699f24;hp=0000000000000000000000000000000000000000;hb=4d07c77cf4d78cab8639e13ddc3c22495e585b0b;hpb=b3950616b54221c40a7dab9099bda675007e5b6e diff --git a/.local/bin/poster b/.local/bin/poster new file mode 100755 index 00000000..c99391b2 --- /dev/null +++ b/.local/bin/poster @@ -0,0 +1,14 @@ +#!/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 +value="{\"content\":\"$@\"}"; +echo $value '{"content":"Posting as a bot"}' ; +curl -v \ +-H "Authorization: Bot TOKEN" \ +-H "User-Agent: myBotThing (http://some.url, v0.1)" \ +-H "Content-Type: application/json" \ +-X POST \ +-d "$value" \ +https://discord.com/api/webhooks/761060841020981268/EZbAW-i5W0VSE4OtUkk3wttvdOAKnCZYuibw231IZhtzMgKUGau2_dYKixGzsgP6s0SB