#Can’t create channels

39 messages · Page 1 of 1 (latest)

robust rain
#

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) });
            });```
jolly cometBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
robust rain
#

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

mellow bronze
#

Guilds can have 500 channels maximum

#

For tickets private threads are better

robust rain
robust rain
robust rain
nimble ruin
#

Probably ratelimit. How often do new channels get created?

robust rain
#

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

nimble ruin
#

Shorter or longer?

robust rain
#

like right now it’s been like 20 minutes away from last channel created and it still won’t create any

nimble ruin
#

How many channels are there on that guild? In total

robust rain
#

it’s less than 500 for sure, but lemme double check

robust rain
#

I used channels forEach to calculate them and that’s the result
Total channels in the guild: 619

nimble ruin
#

So way more than 500… though I suspect some of them to be threads but still sounds like you simply hit the limit

robust rain
nimble ruin
#

Threads aren’t channels on that count, yes

robust rain
#

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

nimble ruin
#

Listen to the rateLimited event

#

Does the bot work otherwise? Or is it hanging completely ?

robust rain
# nimble ruin Listen to the rateLimited event

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}`);
});```
But nothing in the console
robust rain
robust rain
#

do you think I need to fetch the guild or channels or sth?

nimble ruin
nimble ruin
robust rain
robust rain
#

It’ll reset the RateLimit after 15 hours

robust rain
nimble ruin
#

And take the time to redesign your bot to not hit it again

robust rain
nimble ruin
#

No