From 8c8a0153ef3303756c5fccd38834965306661955 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Sun, 3 Jun 2018 15:20:32 +0200 Subject: [PATCH] Revert 9db9d1e's count and fix typo --- readthedocs/extra/changelog.rst | 2 +- telethon/tl/custom/message.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/readthedocs/extra/changelog.rst b/readthedocs/extra/changelog.rst index dee696c5..2185ebc9 100644 --- a/readthedocs/extra/changelog.rst +++ b/readthedocs/extra/changelog.rst @@ -82,7 +82,7 @@ Bug fixes Enhancements ~~~~~~~~~~~~ -- You can now send multiply requests at once while preserving the order: +- You can now send multiple requests at once while preserving the order: .. code-block:: python diff --git a/telethon/tl/custom/message.py b/telethon/tl/custom/message.py index 33093255..93b91318 100644 --- a/telethon/tl/custom/message.py +++ b/telethon/tl/custom/message.py @@ -547,7 +547,7 @@ class Message: returns ``True``. The callable should accept a single `telethon.tl.custom.messagebutton.MessageButton` argument. """ - if (i, text, filter).count(None) >= 2: + if sum(int(x is not None) for x in (i, text, filter)) >= 2: raise ValueError('You can only set either of i, text or filter') if not self.buttons: