need help with building dashboard for discord bot

hey, folks I'm building web dashboard for my discord bot using this code I'm gettings all the guilds in which either user can invite or control the bot
const userGuilds = await axios.get(`${env.BASE_DISCORD_API}/users/@me/guilds`, {
headers: {
Authorization: `Bearer ${token}`,
},
});

const userGuildParsed = guildSchema.safeParse(userGuilds.data);

const guildsWithPermissions = userGuildParsed.data.filter(
({ permissions }) =>
(parseInt(permissions) & 0x20) === 0x20 ||
(parseInt(permissions) & 0x8) === 0x8,
);
const userGuilds = await axios.get(`${env.BASE_DISCORD_API}/users/@me/guilds`, {
headers: {
Authorization: `Bearer ${token}`,
},
});

const userGuildParsed = guildSchema.safeParse(userGuilds.data);

const guildsWithPermissions = userGuildParsed.data.filter(
({ permissions }) =>
(parseInt(permissions) & 0x20) === 0x20 ||
(parseInt(permissions) & 0x8) === 0x8,
);
but now I have problem how can I know the guild in which bot is there and not there do I have also get the botGuilds and compare it with guildWithPermissions
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server