PKlempe / SAM

SAM is a multi-functional Discord Bot specifically designed for the Server of the Faculty of Computer Science at the University of Vienna.
GNU General Public License v3.0
27 stars 6 forks source link

Console Output Clutter Caused by Reaction Listener #227

Closed Azratosh closed 2 years ago

Azratosh commented 2 years ago

Console Output Clutter Caused by Reaction Listener

The pin_message method in bot/utility/utility.py causes a bunch of exceptions to be thrown whenever a user in direct messages reacts to a message. The exceptions themselves are ignored by the bot, therefore having no impact on the bot's functionality in any manner.

The reason this happens is because the member attribute of the received payload (discord.RawReactionActionEvent) is of type Optional[discord.Member], not discord.Member.

A simple guard clause for member fixes the clutter. A pull request is on its way.