#event sometimes got fired 2/3 or event 4 fired

29 messages · Page 1 of 1 (latest)

unborn lionBOT
#
  • 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!
loud silo
#

You most likely have more than one listener registered to the event

loud silo
#

Show me the event handler

fiery loom
#

Is it just that event or is it all ur events you could have multiple instances running

tawdry grove
#

Does the event emit 2-3 times (as in does the console.log show that often) or is it only the channel.send that executes multiple times?

sonic niche
#

@true wolf can you show the file from which you are calling loadEvents?

crystal basalt
#

DuckXYZ also mentioned it above, make sure you're not running your bot multiple times

crystal basalt
#

what is not possible?

#

the bot running multiple times?

tawdry grove
#

How did you determine that to be impossible?

tawdry grove
#

I can run that code three times without issues, so yes, it’s definitely possible

graceful crow
#

I have the same problem and no one know how to solve the problem

graceful crow
#

up 😦

tawdry grove
graceful crow
#

Event fired 2-3-4 times for no reason

tawdry grove
#

And yet you bump this post where you said nothing instead the one you actually had stuff in?

graceful crow
#

My post has been deleted, i can't track him

#

It's maybe a discord problem, i don't know

tawdry grove
#

Yeah, just found it too… it’s not deleted as you see. As I said in there for your case it sends the request three times because it doesn’t receive an ACK from discord in time. So it‘s either a network issue or something blocking the ACKs / Discord not sending them although it received and processed the request

graceful crow
#

Canada servers on vps for discord are bad ?

near raptor
#

I have the same problem.. with a 8.1k guilds bot

graceful crow
#

Yeah and i don't know where's the problem x)

cunning wren
#

I created this post https://discord.com/channels/222078108977594368/1137513755840872449
I still haven't found a good solution.
One day it sends almost every message 2 - 3 times and then for 3 days everything is fine and sends only one.
I increased timeout to 30_000 ms in client options, but the only thing it changed is that messages are posted with 30 seconds delay.
Kinda fixed it by setting rest retries value to 0, but if something goes wrong, bot will not send the message at all
It is definitely Discord issue, because i don't see any network errors logged

graceful crow
cunning wren
#

For big bots more convenient in my opinion is to redirect interactions to the API endpoint. It may behave differently.
But I haven't tested it though

tawdry grove
#

What’s more convenient about that? If you use the gateway anyway you should use it for interactions too. Http interactions are only good for when you don’t use the gateway at all