Incapamentum / Exalted-Sage

Discord bot that does API requests to retrieve a collection of daily achievements for the next day and pushes an alert when any that is in a watchlist shows up.
3 stars 0 forks source link

Connect/Disconnect Event Handlers #68

Closed Incapamentum closed 1 year ago

Incapamentum commented 1 year ago

So the scope of this branch seems to have gone out of the scope of making use of flags to prevent the bot from posting multiple times.

The fundamental issue actually stemmed from the bot handling multiple Connected requests that ended up firing the OnServerReset() function multiple times. Currently, this function does not have a flag system in place to ensure it only gets executed once every hour, and it may be implemented if the double-posting behavior continues.

However, what I'd like to refer to as Task guardrails are being used. This is more-or-less a method of ensuring that the Ready event completes (this is important as it signals to the client that guild data is available) before the Connected event (the handler starts a timer that runs periodic execution of the OnServerReset() method).