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
1 Reply
d.js toolkit
d.js toolkit13mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Want results from more Discord servers?
Add your server