Add examples to all events

This commit is contained in:
Lonami Exo
2020-02-20 10:18:26 +01:00
parent 9f73c35621
commit 3a6c955c90
10 changed files with 143 additions and 0 deletions

View File

@@ -12,6 +12,16 @@ class Raw(EventBuilder):
types (`list` | `tuple` | `type`, optional):
The type or types that the :tl:`Update` instance must be.
Equivalent to ``if not isinstance(update, types): return``.
Example
.. code-block:: python
from telethon import events
@client.on(events.Raw)
async def handler(update):
# Print all incoming updates
print(update.stringify())
"""
def __init__(self, types=None, *, func=None):
super().__init__(func=func)