Androz2091 / discord-giveaways

🎉 Complete framework to facilitate the creation of giveaways using discord.js
https://discord-giveaways.js.org
MIT License
336 stars 127 forks source link

Check if the Client is still online before ending / drawing giveaways based on timestamps #407

Open Tomato6966 opened 2 years ago

Tomato6966 commented 2 years ago

I think my problem is that the CLIENT is not READY yet / a Shard disconnected (internal Shard)

an easy fix, should in theory be adding a if(client.isReady()) function to ensure that the client actually works

or

use the shardReady shardDisconnect etc. and ready event

Because as you can see the shard got disconnected image

another reason could be unavailable guilds, check if the guild.available === false (attention it's nullable) THANKS!

Nico105 commented 2 years ago

For the client it should check every 20s already https://github.com/Androz2091/discord-giveaways/blob/fbf9e1b6367c64d70d714906319951170fd9ba08/src/Manager.js#L587. tho to be safe you can try adding a if in the end function separately. i basically have to ask you to try these possible fixes yourself since I can't repro the issue consistently since I don't manage any big bot anymore where I could test it myself.

Tomato6966 commented 2 years ago

Okay i can try after holidays