Can’t create channels

my bot was working perfectly but after a while it won’t create any more channels:
if (interaction.customId === 'ButtonID') {
await interaction.deferUpdate().catch(err => { console.log(err) });
if (openticket.has(interaction.user.id)) return interaction.followUp({ content: `<@${interaction.user.id}> You already have unclosed ticket `, ephemeral: true }).catch(err => { console.log(err) });
catagory = "CatagoryID"
interaction.guild.channels.create({
name: `🟢-Ticket`,
type: ChannelType.GuildText,
parent: catagory,
topic: "welcome, what do you need?",
permissionOverwrites: [
{
id: interaction.guild.id,
deny: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages]
},
{
id: interaction.user.id,
allow: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ReadMessageHistory, PermissionsBitField.Flags.EmbedLinks, PermissionsBitField.Flags.AttachFiles]
},
]
}).then(async t => {
interaction.followUp({ content: `Your ticket was created: <#${t.id}>`, ephemeral: true }).catch(err => { console.log(err) }); openticket.add(interaction.user.id);
t.send("test").catch(err => { console.log(err) });
}).catch(async err => {
console.log(err);
interaction.followUp({ content: `${err}`, ephemeral: true }).catch(err => { console.log(err) });
});
if (interaction.customId === 'ButtonID') {
await interaction.deferUpdate().catch(err => { console.log(err) });
if (openticket.has(interaction.user.id)) return interaction.followUp({ content: `<@${interaction.user.id}> You already have unclosed ticket `, ephemeral: true }).catch(err => { console.log(err) });
catagory = "CatagoryID"
interaction.guild.channels.create({
name: `🟢-Ticket`,
type: ChannelType.GuildText,
parent: catagory,
topic: "welcome, what do you need?",
permissionOverwrites: [
{
id: interaction.guild.id,
deny: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages]
},
{
id: interaction.user.id,
allow: [PermissionsBitField.Flags.ViewChannel, PermissionsBitField.Flags.SendMessages, PermissionsBitField.Flags.ReadMessageHistory, PermissionsBitField.Flags.EmbedLinks, PermissionsBitField.Flags.AttachFiles]
},
]
}).then(async t => {
interaction.followUp({ content: `Your ticket was created: <#${t.id}>`, ephemeral: true }).catch(err => { console.log(err) }); openticket.add(interaction.user.id);
t.send("test").catch(err => { console.log(err) });
}).catch(async err => {
console.log(err);
interaction.followUp({ content: `${err}`, ephemeral: true }).catch(err => { console.log(err) });
});
5 Replies
d.js toolkit
d.js toolkit8mo 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! - Marked as resolved by OP
Khalid
KhalidOP8mo ago
Additional notes, idk if it will help but my guild is kinda big it has about 12k members and they open a lot of channels by the bot
darp
darp8mo ago
Guilds can have 500 channels maximum For tickets private threads are better
Khalid
KhalidOP8mo ago
I checked that earlier it should ping me in the console but no nothing it’s kinda old style server that’s why After they clicking the button the bot will reply with interaction.deferUpdate().catch(err => { console.log(err) }); then it’ll stop without creating the channels, btw it was working perfectly so idk what is the problem here Tbh they creating a lot of the channels but I didn’t face this problem before it’s not like 1 minute between each channel longer like right now it’s been like 20 minutes away from last channel created and it still won’t create any it’s less than 500 for sure, but lemme double check and by the channels you mean all of them? I used channels forEach to calculate them and that’s the result Total channels in the guild: 619 so the threads aren’t counting in the limits? Total channels in the guild (excluding threads): 448 I recheck the number without the threads; However even if I reached the 500 limit it’ll ping me in the console as it was before but right now it’ll not log anything I tried
client.on('rateLimit', (info) => {
console.log(`Rate limit hit: Timeout - ${info.timeout}ms, Limit - ${info.limit} requests, Method - ${info.method}, Path - ${info.path}, Route - ${info.route}, Global - ${info.global}`);
});
client.on('rateLimit', (info) => {
console.log(`Rate limit hit: Timeout - ${info.timeout}ms, Limit - ${info.limit} requests, Method - ${info.method}, Path - ${info.path}, Route - ${info.route}, Global - ${info.global}`);
});
But nothing in the console it’s listening to dropdown menu interactions also here it replies with interaction.deferUpdate().catch(err => { console.log(err) }); but it won’t create the channel idk why do you think I need to fetch the guild or channels or sth? Rate limit hit! Timeout: undefinedms Request Route: /guilds/:id/channels Request Method: POST Global: false Limit: 2000 It’ll reset the RateLimit after 15 hours and how do I skip this Rate limit? does the verified bots has a higher rate limits?
d.js docs
d.js docs8mo ago
Ratelimits are dynamically assigned by the API based on current load and may change at any point. - The scale from okay to API-spam is sliding and depends heavily on the action you are taking - Rainbow roles, clock and counter channels, and DM'ing advertisements to all members are all examples of things that are not okay
Want results from more Discord servers?
Add your server