Aditya Kirad
Aditya Kirad
Explore posts from servers
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
hey can you also check this it's giving me wrong number of counts
const guild = interaction.guild;
const members = guild.members.cache;
let totalMemberCount = 0;
let actualMemberCount = 0;
let botCount = 0;

members.forEach(member => {
++totalMemberCount
if(member.user.bot) {
++botCount
} else {
++actualMemberCount
}
})

const channelsCount = guild.channels.cache.size;
const rolesCount = guild.roles.cache.size;
const emojiCount = guild.emojis.cache.size;
const stickersCount = guild.stickers.cache.size;
const boostsCount = guild.premiumSubscriptionCount;
const guild = interaction.guild;
const members = guild.members.cache;
let totalMemberCount = 0;
let actualMemberCount = 0;
let botCount = 0;

members.forEach(member => {
++totalMemberCount
if(member.user.bot) {
++botCount
} else {
++actualMemberCount
}
})

const channelsCount = guild.channels.cache.size;
const rolesCount = guild.roles.cache.size;
const emojiCount = guild.emojis.cache.size;
const stickersCount = guild.stickers.cache.size;
const boostsCount = guild.premiumSubscriptionCount;
also this code does not places the category at the top position
const category = await interaction.guild.channels.create({
name: '📊 SERVER STATS 📊',
type: ChannelType.GuildCategory,
position: 1
});
const category = await interaction.guild.channels.create({
name: '📊 SERVER STATS 📊',
type: ChannelType.GuildCategory,
position: 1
});
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
i think this is due category.id
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
I'm getting this error
[0] Error executing setup
[0] TypeError [InvalidType]: Supplied parameter is not a User nor a Role.
[0] at Function.resolve (E:\Discord Bots\Server Stats\node_modules\discord.js\src\structures\PermissionOverwrites.js:184:28)
[0] at E:\Discord Bots\Server Stats\node_modules\discord.js\src\managers\GuildChannelManager.js:168:81
[0] at Array.map (<anonymous>)
[0] at GuildChannelManager.create (E:\Discord Bots\Server Stats\node_modules\discord.js\src\managers\GuildChannelManager.js:168:51)
[0] at Object.<anonymous> (E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:102:30)
[0] at Generator.next (<anonymous>)
[0] at E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:8:71
[0] at new Promise (<anonymous>)
[0] at __awaiter (E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:4:12)
[0] at createChannel (E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:101:80) {
[0] code: 'InvalidType'
[0] }
[0] Error executing setup
[0] TypeError [InvalidType]: Supplied parameter is not a User nor a Role.
[0] at Function.resolve (E:\Discord Bots\Server Stats\node_modules\discord.js\src\structures\PermissionOverwrites.js:184:28)
[0] at E:\Discord Bots\Server Stats\node_modules\discord.js\src\managers\GuildChannelManager.js:168:81
[0] at Array.map (<anonymous>)
[0] at GuildChannelManager.create (E:\Discord Bots\Server Stats\node_modules\discord.js\src\managers\GuildChannelManager.js:168:51)
[0] at Object.<anonymous> (E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:102:30)
[0] at Generator.next (<anonymous>)
[0] at E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:8:71
[0] at new Promise (<anonymous>)
[0] at __awaiter (E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:4:12)
[0] at createChannel (E:\Discord Bots\Server Stats\src\commands\server_stats\setup.ts:101:80) {
[0] code: 'InvalidType'
[0] }
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
const createChannel = async (name: string, permissions: OverwriteData[]) => {
await guild.channels.create({
name: name,
type: (channelType === channelOption.voice ? ChannelType.GuildVoice : channelType === channelOption.text ? ChannelType.GuildText : channelType === channelOption.announcement ? ChannelType.GuildAnnouncement : channelType === channelOption.stage ? ChannelType.GuildStageVoice : null),
parent: category.id,
permissionOverwrites: [
{
id: category.id,
deny: [PermissionFlagsBits.SendMessages, channelType === channelOption.voice || channelType === channelOption.stage ? PermissionFlagsBits.Connect : '0']
},
{
id: mutedRole.id,
deny: [PermissionFlagsBits.SendMessages]
},
...permissions
]
})
}
const createChannel = async (name: string, permissions: OverwriteData[]) => {
await guild.channels.create({
name: name,
type: (channelType === channelOption.voice ? ChannelType.GuildVoice : channelType === channelOption.text ? ChannelType.GuildText : channelType === channelOption.announcement ? ChannelType.GuildAnnouncement : channelType === channelOption.stage ? ChannelType.GuildStageVoice : null),
parent: category.id,
permissionOverwrites: [
{
id: category.id,
deny: [PermissionFlagsBits.SendMessages, channelType === channelOption.voice || channelType === channelOption.stage ? PermissionFlagsBits.Connect : '0']
},
{
id: mutedRole.id,
deny: [PermissionFlagsBits.SendMessages]
},
...permissions
]
})
}
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
solved that error due to which i was not getting option value btw can you look at this
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
you there @lil bubby
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
there is not guildMessageContent
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
btw is there any method in discord.js by which i can get all intents like there is a method in hikari to get all intents which is hikari.intents.all
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
I got guildMessages
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
what intent does I need for it
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
but that can't be reason due to which I'm getting empty value when I log the options value
23 replies
DIAdiscord.js - Imagine an app
Created by Aditya Kirad on 5/2/2023 in #djs-questions
channels not creating
node version latest
23 replies