Aditya Kirad
Aditya Kirad
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 12/21/2023 in #djs-questions
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
2 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
hey folks can anyone check this code if I run the setup commmand and choose options voice and default only the category is created the channels does not create also the value of options logs empty
23 replies