Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
TL;DR
Reactions to pronoun messages now work after restarting the bot
Description
When the
/pronoun
command is run, it now saves a copy of the message ID and channel ID to Firebase under theInitBotInfo > [server ID] > SavedMessages -> pronouns
document. When the bot is restarted, it will check for this document, and if there is an existing message/channel saved, it will use those to start emoji reaction listeners, allowing the old message to continue to be used for pronoun role reactions.In addition, the bot startup was also changed so that each server is initialized sequentially instead of in parallel. This just makes the debug messages less confusing since they're not being logged asynchronously.
Why
If the bot crashes, we will lose emoji reaction listeners on messages that have already been sent. This change will allow us to more easily recover from bot crashes.
User Changes
None :D
Tests Done
Tested restarting the bot and adding/removing reaction emojis, then verifying that roles are added/removed correspondingly
Breaking Changes
None - if no existing saved message is found, the bot just continues as normal