fix: Handle UNKNOWN_MESSAGE exception in SuggestionsUpDownVoter by Bryce72 · Pull Request #1415 · Together-Java/TJ-Bot

Conversation

@Bryce72

Fixes #1414
When a spam message is posted in the suggestions channel, both ScamBlocker and SuggestionsUpDownVoter react to it. If ScamBlocker deletes the message first, SuggestionsUpDownVoter throws an ErrorResponseException [10008] (UNKNOWN_MESSAGE) when trying to create a thread or react.
This PR explicitly handles that exception and logs it as INFO instead of ERROR, since it's expected behavior.

@CLAassistant

CLA assistant check
All committers have signed the CLA.

ankitsmt211

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't know for a fact that message was deleted by scamBlocker(most likely yes) but it's a good idea to keep things more to the point. We only know message was no longer available so we stick to that.

…ly with an INFO log instead Together-Java#1414

Refactored and idomaticized -- oops updated to make sure its similar via both react and create thread

ankitsmt211

ankitsmt211

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good

SquidXTV