#Ready event gets triggered every few hours
1 messages · Page 1 of 1 (latest)
It is possible that shards randomly close due to any kind of reason
This triggers a reconnect and therefore another Ready event
Yeah ready will happen many times, just how it is.
This is caused by an bug that's fixed in https://github.com/twilight-rs/twilight/pull/1932
not necessary 
ohh that's awesome. I thought that this was odd.. I was using discord.js some time ago and my bots never received that many ready events 
Do you run your bot using the next branch?
Discord.js ready event cannot be compared to Twilight ones
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
oh interesting.. I thought that the event (in both discordjs and twilight) would just be the same as the ready event from discord itself (https://discord.com/developers/docs/topics/gateway-events#ready). Good to know.
They use the same ready event.
Discord.js just abstracts it in their own custom implementation
👍
and twilight doesn't alter it?
yes
good to know! Thanks for clarifying :) Love using twilight so far. I like the unopinionated approach.
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?)
@radiant sedge I don't think that I'm doing something unusual
... I used an example from the twilight docs on how to initiate a cluster/connect to the gateway.
Have a look here:
https://github.com/GiyoMoon/EVE/blob/a8a699ceedab2598c78486db885335c0a2f2ed4e/src/bot.rs#L14
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