Gabor Szita
Gabor Szita

Reputation: 329

Discord OAuth2 how to check if a bot is in (joined) a guild

I'm using Discord OAuth2 for my discord bot dashboard. I retrieve the user's servers by the link https://discord.com/api/users/@me/guilds. I want to prompt the user to add my bot to his guild or go directly to the dashboard if the bot is already in the user's guild. But how do I know if the bot is already in a guild? I didn't find any API that does this.

Upvotes: 6

Views: 1471

Answers (1)

Kae
Kae

Reputation: 638

It's an API request per guild, but you could use get guild member with your own bot's ID; if you get a 4xx then your bot isn't present in the guild.

Upvotes: 2

Related Questions