Skip to content Skip to sidebar Skip to footer

Discord.js Get User Connections As Bot

Hey I'm trying to make a bot that will check user's connected battle.net account and load game rank. I'm using discord.js library and trying to acccess UserProfile via bot, which i

Solution 1:

Unfortunately this is not possible when using a "real" bot account, however it is possible if you're using a user bot account.

I'd suggest a workaround of using OAuth2. You could have users authenticate your bot with OAuth2, and then fetch their connections this way. Some more information at https://discordapp.com/developers/docs/topics/oauth2

Solution 2:

I think I might have a way to get close to that. It took me a while, but I think I've figured out how you can check if someone (in my case, just the bot itself) is playing a certain game. You could probably replace client.user with the user you want to check. Here's the code:

if (client.user.presence.game.name == "INSERT GAME TO LOOK FOR HERE") {  
    ACTION TO BE CARRIED OUT
} 

Post a Comment for "Discord.js Get User Connections As Bot"