Created
February 9, 2018 04:51
-
-
Save atpons/24f2399bc7280bcb843bdbe11aca00c4 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
# Discord へ指定フォルダ内のemojiをupload | |
# @atpons / MIT License | |
TOKEN=TOKEN_OF_BOT | |
DIR=DIRECTORY | |
ID=SERVER_ID | |
for file in `\find $DIR -maxdepth 1 -type f`; do | |
NAME=`basename $file | sed 's/\.[^\.]*$//' | sed 's/-/_/g'` | |
IMG=`base64 $file` | |
echo $NAME | |
curl -H 'Content-Type:application/json' -H "Authorization:Bot $TOKEN" -d "{\"name\":\"$NAME\",\"image\":\"data:image/png;base64,$IMG\"}" https://discordapp.com/api/guilds/$ID/emojis | |
sleep 1 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment