diff --git a/readthedocs/quick-references/client-reference.rst b/readthedocs/quick-references/client-reference.rst index f9ef8274..52e7d71a 100644 --- a/readthedocs/quick-references/client-reference.rst +++ b/readthedocs/quick-references/client-reference.rst @@ -88,6 +88,7 @@ Downloads download_media download_profile_photo download_file + iter_download Dialogs ------- @@ -130,6 +131,7 @@ Chats iter_participants get_participants + kick_participant iter_admin_log get_admin_log iter_profile_photos diff --git a/telethon/client/buttons.py b/telethon/client/buttons.py index 22e6bebf..7e848ab1 100644 --- a/telethon/client/buttons.py +++ b/telethon/client/buttons.py @@ -35,7 +35,8 @@ class ButtonMethods: from telethon import Button markup = client.build_reply_markup(Button.inline('hi')) - await client.send_message('click me', buttons=markup) + # later + await client.send_message(chat, 'click me', buttons=markup) """ if buttons is None: return None diff --git a/tests/readthedocs/__init__.py b/tests/readthedocs/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/readthedocs/conftest.py b/tests/readthedocs/conftest.py new file mode 100644 index 00000000..9aad9580 --- /dev/null +++ b/tests/readthedocs/conftest.py @@ -0,0 +1,8 @@ +import pathlib + +import pytest + + +@pytest.fixture +def docs_dir(): + return pathlib.Path('readthedocs') diff --git a/tests/readthedocs/quick_references/__init__.py b/tests/readthedocs/quick_references/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/readthedocs/quick_references/test_client_reference.py b/tests/readthedocs/quick_references/test_client_reference.py new file mode 100644 index 00000000..ad720d54 --- /dev/null +++ b/tests/readthedocs/quick_references/test_client_reference.py @@ -0,0 +1,14 @@ +import re + +from telethon import TelegramClient + + +def test_all_methods_present(docs_dir): + with (docs_dir / 'quick-references/client-reference.rst').open(encoding='utf-8') as fd: + present_methods = set(map(str.lstrip, re.findall(r'^ {4}\w+$', fd.read(), re.MULTILINE))) + + assert len(present_methods) > 0 + for name in dir(TelegramClient): + attr = getattr(TelegramClient, name) + if callable(attr) and not name.startswith('_'): + assert name in present_methods