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

Giveaway doesn't send the end message or log in end event! #465

Closed oMvhmoud closed 2 years ago

oMvhmoud commented 2 years ago

Describe the bug

The giveaway when ends, doesn't send the end message until I restart the bot.

Error
None.

To Reproduce Create a giveaway and wait until it ends.

Expected behavior
Bot sends the end message and log it in the end event.

Screenshots
https://prnt.sc/mfUQhJWPrC0o

Additional context

Add any other context about the problem here.

oMvhmoud commented 2 years ago

tried quickmongo and the same issue

Nico105 commented 2 years ago

If you look into your db when the giveaway 1st ended, is ended = true?

Nico105 commented 2 years ago

And you waited some time before you restarted right?

oMvhmoud commented 2 years ago

And you waited some time before you restarted right?

yes i waited for about 10 mins which is enough, about the ended it's false always until i restart image

oMvhmoud commented 2 years ago

any updates ?

Nico105 commented 2 years ago

Could you provide your client options?

oMvhmoud commented 2 years ago

Could you provide your client options?

client.giveawaysManager = new GiveawaysManagerMongoose(client, { default: { botsCanWin: false, embedColor: "#00FFC1", reaction: "🎉", embedColorEnd: "#ff0000", lastChance: { enabled: true, content: "⚠️ **LAST CHANCE TO ENTER !** ⚠️", threshold: 10000, embedColor: "#FF0000" } } });

if you mean fucntions it's the same as the mongoose example you provides.

Nico105 commented 2 years ago

i meant your options for the discord.js client, or you maybe named it "bot"

oMvhmoud commented 2 years ago

i meant your options for the discord.js client, or you maybe named it "bot"

oh, sorry i didn't see that, however im using ur example file mongoose.js so the client is the same.

Nico105 commented 2 years ago

does it happen for every giveaway you start?

oMvhmoud commented 2 years ago

does it happen for every giveaway you start?

ofc, also sorry for being reply late, but my pc was dead however hope you help me.

Lebyy commented 2 years ago

Can re-produce this the giveaway edit's the message to show the winners but doesn't end in database neither fires the giveawayEnded event. image

Nico105 commented 2 years ago

I reverted the changes that are at fault for this. If you update everything should work again. LMK The slightly weird/annoying thing is, I wasn't able to repro this in my test bot, probably because of its simplicity/low load level. The thing is, those little persistent problems somehow never affect all users and only some, even when the settings are simple or the same as mine.

Those changes were an attempt to fix issues like #392 #445 and the ones that got closed. Unfortunately this will leave those open. (I don't even know if those changes would have fixed them since I didn't get to ask yet, but logically the system should have improved the situation). The issue this time lies in unknown errors/behavior of discord.js message edits, which affected the checking system that now got reverted. 😩

oMvhmoud commented 2 years ago

However, Thanks for fixing this problem I tested the bot on version 5.2.2 and it's working good now!