fix: bug IDFilter checking message from channel (#376)

* fix: bug IDFilter checking message from channel

* chore: add mark.asyncio for tests which were ignored previously
This commit is contained in:
Egor 2020-07-05 03:08:38 +03:00 committed by GitHub
parent 5586e5110d
commit f904292751
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 33 additions and 3 deletions

View file

@ -591,7 +591,9 @@ class IDFilter(Filter):
async def check(self, obj: Union[Message, CallbackQuery, InlineQuery]):
if isinstance(obj, Message):
user_id = obj.from_user.id
user_id = None
if obj.from_user is not None:
user_id = obj.from_user.id
chat_id = obj.chat.id
elif isinstance(obj, CallbackQuery):
user_id = obj.from_user.id