Last active
February 21, 2024 19:56
-
-
Save EntityPlantt/dbe75a9e1a93706e397a8cf76631930b to your computer and use it in GitHub Desktop.
Hue rotate PFP for your Discord bot
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
const {execSync: cmd} = require("child_process"), fs = require("fs"); | |
for (var i = 0; i < 200; i += 10) cmd(`magick og.png -modulate 100,100,${(i + 100) % 200} -quality 85% hue${i}.jpg`); | |
cmd(`convert -delay 5 -loop 0 ${Array(20).fill(0).map((x, i) => `hue${i * 10}.jpg`).join(" ")} final.gif`); | |
let data = `{"avatar":"data:image/gif;base64,${fs.readFileSync("final.gif").toString("base64")}"}`; | |
fs.writeFileSync("final.txt", data); | |
cmd(`cat final.txt | curl -H "Authorization: Bot $(cat auth.txt)" -H "Content-Type: application/json" -X PATCH --data-binary @- https://discord.com/api/users/@me`); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Creates a hue rotation PFP and sets it automatically on your Discord bot.
Utilization of the new Discord Bot feature.
Prequisities
sudo apt-get install magick
,rpm-ostree install magick
)auth.txt
og.png
node rbpfp
Example