Created
February 17, 2019 03:36
-
-
Save yutsuku/b0f83665b11ce04354a9453447de4260 to your computer and use it in GitHub Desktop.
bash script to easily change Discord Bot avatar
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 | |
if [ -z "$1" ] | |
then | |
echo "Usage: $0 your-image.jpg" | |
exit | |
fi | |
# get your "Bot" token from | |
# https://discordapp.com/developers/applications/ | |
token="<bot-token-goes-here>" | |
b64=$(base64 -w 0 $1) | |
avatar="data:image/jpeg;base64,"$b64 | |
(echo -n "{\"avatar\": \"$avatar\"}") | curl -H "Authorization: Bot $token" -H "Content-Type: application/json" -X PATCH -d @- https://discordapp.com/api/users/@me |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment