Reputation: 60
Im trying to make a discord dashboard all out of Pure HTML (Includes JS, CSS just to be clear), and I wanted to get a list of all the guilds the bot is in without any other APIs like discord.py or discord.js. How can I do this? I couldn't find anything on the Discord Developer Documentation, and is it even possible?
I've tried some answers like getting '/users/@me/guilds', but it just returns the current person that is logged in with the bot's guilds, and not what the bot has joined.
Thanks.
Upvotes: 2
Views: 1092
Reputation: 142
You should make an HTTP requests with your bot's token:
URL: https://discord.com/api/v9/users/@me/guilds
HEADERS: Authorization: "Bot TOKEN"
It will return a JSON with all the guilds your bot is in. But make sure you don't leak your bot's token somewhere in JS or HTML files. I guess this should work, have a good day! :D
Upvotes: 1