I’m working on a Discord bot that needs to post a message with an image attachment and some text content. After posting, the bot should update the message text multiple times in sequence. The issue I’m running into is that after about 5 edits, there’s a pause of around 2 seconds before it continues with the next batch of edits. This creates an unwanted delay pattern that repeats throughout the editing process. I want the message updates to happen smoothly without these interruptions. Is there a way to prevent these pauses from occurring?
if(message.content.includes("numbers")){
message.channel.send("counting", { files: ["/path/to/image/counter.jpg"]})
}
if(message.content === 'counting'){
message.edit("**1**")
message.edit("**2**")
message.edit("**3**")
message.edit("**4**") // Bot pauses here for 2 seconds
message.edit("**5**")
message.edit("**6**")
message.edit("**7**")
message.edit("**8**")
message.edit("**9**") // Another 2 second delay occurs
message.edit("**10**")
message.delete()
}
yeah, that’s totally a rate limit issue. discord’s api gets annoying with fast edits. just add some setTimeout()
or await
delays in between the edits - should fix the problem!
Yeah, you’re hitting Discord’s rate limits from editing too fast. Had the same issue building a bot last year. Discord automatically throttles you when you make a bunch of rapid edits without any timing control. Don’t fight the rate limits - just add a 500-800ms delay between edits. Or better yet, batch your changes and do fewer updates instead of editing every single number. What worked for me was either using one edit with animated text or just showing the final result instead of that step-by-step counting thing.
Discord rate limits message edits after too many rapid changes - that’s what’s causing your throttling. Don’t just throw delays everywhere. You need proper rate limit handling. Set up a queue system with controlled timing between edits, or better yet, redesign it to need fewer edits total. I’ve had success batching content changes or using reactions instead of constantly updating text for countdown features. Those pauses won’t stop until you work with Discord’s limits instead of fighting them.