Fix MessageRead had blacklist_chat=None and not False

This was causing the checks against chats to fail. In addition
to that, before setting the attribute, it is now casted to bool
to prevent more issues like this in the future (or if users
use non-boolean values).
This commit is contained in:
Lonami Exo 2019-03-31 12:14:34 +02:00
parent c95467ea3e
commit 34a8140ff0
2 changed files with 2 additions and 2 deletions

View File

@ -69,7 +69,7 @@ class EventBuilder(abc.ABC):
def __init__(self, chats=None, *, blacklist_chats=False, func=None):
self.chats = chats
self.blacklist_chats = blacklist_chats
self.blacklist_chats = bool(blacklist_chats)
self.resolved = False
self.func = func
self._resolve_lock = None

View File

@ -15,7 +15,7 @@ class MessageRead(EventBuilder):
when messages you sent are read by someone else will fire it.
"""
def __init__(
self, chats=None, *, blacklist_chats=None, func=None, inbox=False):
self, chats=None, *, blacklist_chats=False, func=None, inbox=False):
super().__init__(chats, blacklist_chats=blacklist_chats, func=func)
self.inbox = inbox