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

Deleted message crashes bot. #173

Closed DomeQdev closed 3 years ago

DomeQdev commented 3 years ago

DomeQdev commented 3 years ago

Okay, I fixed it, but add it in next update src/Manager.ejs:398: giveaway.message.edit(giveaway.messages.giveaway, { embed }).catch(() => {})

wolfier74 commented 3 years ago

Make that bot will delete the giveaway from database when message was deleted

Nico105 commented 3 years ago

Make that bot will delete the giveaway from database when message was deleted

This is a little risky because the error can also be caused when the Discord API bugs around or sometimes it is not able do fetch all giveaways at the first attempt, especially when the bot has a lot of giveaways active and has a lot of servers. I experienced the later case and had to restart my bot until it was able to fetch all giveaways. My opinion would be that this should be added through extending the manager on own risk.

Androz2091 commented 3 years ago

I agree with @Nico105, and I would like to add that personally I like that my bot can resume a giveaway even if for a few minutes it was removed from the giveaway channel for example. But indeed, it's very painful to receive error messages in the terminal so I added .catch and it no longer logs them.

(will be available in the next release)