Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

338
Views
Why does my code seem to stop at Interaction.editReply()?

I was making a game command in discord.js, but when attempting to editReply, it won't go past that... I tried putting console logs before and after, and the one after didn't run. I tried using await interaction.deferReply(), and that just stayed on BotName is thinking.... The arguments are passed in correctly and there aren't any errors.

Here is the code:

async execute(client, interaction, args) {
    await interaction.reply(`valid string here`) // does send
    let num = Math.floor((Math.random() * (args[0] || 1000)) + 1); //get random number
    let guesses = 0;
    let logs = ["None"];
    console.log("Running 1") // logs
    await interaction.editReply(
      `valid string here`
    )
    console.log("Running 2") // doesn't log and doesn't edit
    // ...
}

After using client.on("debug") and client.on("warn"), it seems I'm getting a 429, but I'm not even looping, and it was working just fine yesterday

Hit a 429 while executing a request.
    Global  : false
    Method  : patch
    Path    : /webhooks/---/messages/@original
    Route   : /webhooks/:id/---/messages/@original
    Limit   : Infinity
    Timeout : 500ms
    Sublimit: 1130000ms
about 4 years ago · Santiago Gelvez
1 answers
Answer question

0

Your new edit to the question most likely answers your question. If you host a bot on replit (especially with free hosting), it is likely that your bot will share an IP with other bots hosted on replit. Discord's rate limits are enforced based on the IP that is requesting the API. All it takes for this error to occur is for someone else on replit (whose bot happens to share the same IP as yours) to create a poorly/maliciously designed discord bot that spams the API and causes your bot's IP to get rate limited. In this case, I assume someone was using .editReply() too much in a poorly designed loop or such.

As for a solution to this issue, I found this replit post. It suggests that you can "run kill 1 in the shell tab to destroy the current container and switch to a new one." That post is from 10 months ago, so it may or may not work now. (If this doesn't work, an alternate solution could also be to fork your own repl, and then delete the original. This may also switch your bot over to a new IP).

about 4 years ago · Santiago Gelvez Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!