Bot responds multiple times

A few hours ago (about 8) my bot started responding multiple times to a single command (where it didn’t do this before). No code has changed.

For example, I have a piece that takes an input and returns a calculation. Currently it’s doing this:

input: /ai 3.78
Output:
Activity Index of 3.78 is 59.17 hours of played time.
Activity Index of 3.78 is 27.61 hours of played time.

In this case, the 59.17 is an old calculation value that was there, 27.61 is the current value that’s in the project code.

sorry i’m not the help you need, but my bots have been doing this constantly as well :frowning:

Reset the bot token and then paste that resetted bot token to the client.login(‘TOKEN’) line.

this will not fix, i already tried and can not work for the post owner

i’ve been doing this at least once a day… do i really have to do this every time it breaks?

Glitch is having a outage right now. Maybe there is a multiple interface is running the bot.

it’s been doing this since june 11th. i thought maybe it was me doing something wrong but now that i’ve come to the forums to see it’s happening often, i see that it’s not my bot.

i just said that i have to do it at least once a day. i don’t think that’s a reasonable answer?

Reset the bot token is a solution but an other instance of the bot will still run, so reset ALL tokens if there is multiple tokens needed.

Once a day ??? That’s really weird. You’re the first case I’ve ever seen to have this kind of stuff every day… :thinking:

Maybe, that a reasonable answer for it, i guess.

the bot either turns itself off with “(node:20917) UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.” or sends messages/does commands two or three times in a row. every time i regen the token & paste back in, only for it to mess up within 24 hours. i haven’t changed any code in the bot for months but it somehow will mess itself up.

Because sometimes you are pasting the wrong token. Try re-reseting your bot’s token and paste it in the client.login line or here is the config.json is.

i’m not pasting the wrong token though, i’m regenning it & pasting it in the same spot every single time, for the bot to work for another day or so then suddenly double sending messages or getting that error code. if i’m pasting the wrong one, it wouldnt start to work again in the first place. i have 2 bots both run on glitch, ones used way less, but both will start double sending messages out of nowhere.

Because you are pasting the same token for the same project and to a different project.

no, i’m not. both have different statuses on them, i would know if they both had the same token attached because they would both have the same playing/status on them…?

Because they have an error in common. I have two bots perfectly running (when they run [ref. to recent outages and ping ban]) and one of them is in development. If you need help, give a link to the code, it would be faster as the error can be in multiple places in the code (so you don’t have to copy/paste a bunch of files. Make sure your tokens are in the .env file if you invite someone to view your code.

they are two completely different bots, i would know if one started to act like the other…

this did start to happen once i boosted my bots & chose the “always on” option. i’m not sure if this has anything to do with it, but before when i used uptimerobot they would go down sometimes, but never error out or send double messages. just thought that was a weird coincidence.

i would have to double check that the tokens are in .env but i can’t open the code now anyways, i think glitch is struggling at the moment as well. i’ll double check & come back later.

I don’t know how “boosting” works but it might run 2 times the app ? One not boosted and one boosted but both are updated ? My theory might be farfetched tho.

not sure, ive just noticed that it’s often started to have multiple nodes/instances & doing commands twice since i updated to the paid plan. :frowning: thanks for trying to help, i’ll send an invite when glitch is loading my code at all. i can load one bot, but not the other

After thinking a bit further about it, I think it might be directly a Glitch issue, please send an email there : [email protected]

ah, ok. i can do that. thanks!

sorry OP for bombarding your thread, i just came to say i had the same problem & didn’t realize people would respond when this had no replies lol!

Maybe Glitch is having a outage now.

I will ask the OP that, did you try refreshing your bot’s token, and can you answer it there? Or maybe you are running the same code in your local computer or created a other project and forgot to delete it maybe? Or can you check that isn’t code is having a issue? (like sending the message twice)

I’m going to try resetting the bot’s token. The code isn’t running on a local PC, nor is it on another project. The code was working fine, and then just started duplicating without a code change, which is why it’s weird. Once I reset the token, I’ll report back to see if it did anything.

@maeglutz - no worries about the bombarding, if it leads to a solution the thread did its job!

Regenerated my bot token and updated the program with it, now the bot won’t initialize it seems.

Can you share the logs?

mine also started to duplicate without a code change as well. is your error “UnhandledPromiseRejectionWarning: Error: Incorrect login details were provided.” by chance?

This error is occurred because you entered the wrong bot token.

This is the error that my log showed eventually:

(node:1045) UnhandledPromiseRejectionWarning: Error: Something took too long to do. at timeout.client.setTimeout (/rbd/pnpm-volume/04d3cbf8-1c8f-4c8c-8244-9d3c344f7eb6/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/ClientManager.js:40:57) at Timeout.setTimeout [as _onTimeout] (/rbd/pnpm-volume/04d3cbf8-1c8f-4c8c-8244-9d3c344f7eb6/node_modules/.registry.npmjs.org/discord.js/11.5.1/node_modules/discord.js/src/client/Client.js:436:7) at ontimeout (timers.js:436:11) at tryOnTimeout (timers.js:300:5) at listOnTimeout (timers.js:263:5) at Timer.processTimers (timers.js:223:10) (node:1045) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 9) (node:1045) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Your project was IP banned.
Post your project name on the Discord Ban Mega Thread.

1 Like

Posted there, thanks!

There about my post i mentioned the 429 (Too Many Requests) issue.

I’m experiencing the same issue on my boosted app Slack (not discord) bot.
It seems like an older version of my code is also still running while the updated version is running resulting in incoming chat-messages triggering both the old & new version of their respective messagehandlers, resulting in the bot responding twice.

Okay, so right Glitch is under unplanned maintince. So, this is expected to happen. If you get a 429 from discord, go post on the megathread. (I will post it for you if you need to.) Making a new project will most likely ban that IP too. If you need other assistance me and other members can help you.

Yeah, I tried the remixing solution and now it’s not recognizing the express module, which I suppose means just a sit and wait time. :slight_smile:

No, Its something that’s been happening ALOT it has not been blocked at all most of the times this will fix it killall -u app
hope it helps

1 Like

I don’t know if this is still needed but a possible issue is that your bot is running the main script, and then also running separate versions from the debugger. If you run your code in a debugger it actually runs it on a new thread, so if you don’t cancel (ctrl+c in the terminal) those debugger versions they will also run along with the main one, creating two or three versions of the bot all active at the same time.
Found this out the hard way

bump

Thank you for your response, but please refrain from bumping thread?

1 Like

Your typical problem with bots.

You ran the bot too many times, regenerate your token and wait a few minutes, after that, put the new generated token.

To prevent this problem, make sure your bot is online before running “node .” again in terminal.