#Ready event gets triggered every few hours

1 messages · Page 1 of 1 (latest)

night hedge
#

I have noticed that I am getting ready events every few hours.... This seems odd to me because I thought the ready event was only sent when the bot initially connects to the gateway and not when it resumes.... Am I missing something?
(Log attached, every message is a ready event being triggered)

coarse stump
#

It is possible that shards randomly close due to any kind of reason

#

This triggers a reconnect and therefore another Ready event

flat condor
#

Yeah ready will happen many times, just how it is.

radiant sedge
coarse stump
#

not necessary think

night hedge
coarse stump
#

Do you run your bot using the next branch?

coarse stump
night hedge
#

no I'm using the latest version from crates.io

coarse stump
#

Yes

#

so basically discord.js has their custom ready event

#

this event gets fired after a shard got connected to discord and all guilds have been cached

#

twilight sends the ready event every time a shard got connected ignoring whether all guilds got cached

#

in fact you will probably have 0 guilds cached when you get the ready event from that shard

#

discord.js also emits the ready event only once after startup and then never again. This is not the case with twilight

night hedge
coarse stump
#

They use the same ready event.

#

Discord.js just abstracts it in their own custom implementation

night hedge
#

👍
and twilight doesn't alter it?

coarse stump
#

yes

night hedge
#

good to know! Thanks for clarifying :) Love using twilight so far. I like the unopinionated approach.

radiant sedge
#

Do you not connect directly to discord?

#

Discord sends the ready event after a gateway identify was sent (which should only happen once, at startup) as the gateway will try to resume after getting disconnected (which does not involve reidentifying and receiving a ready event). I'd investigate why your bot needs to reidentfy (does discord constantly invalidate your session?)

night hedge
#

and at the bottom I'm awaiting the ready events

#

And I'm sure that the service itself isn't restarting somehow due to crashing