TelegramClient
The TelegramClient
aggregates several mixin
classes to provide all the common functionality in a nice, Pythonic interface.
Each mixin has its own methods, which you all can use.
In short, to create a client you must run:
from telethon import TelegramClient
client = TelegramClient(name, api_id, api_hash)
async def main():
# Now you can use all client methods listed below, like for example...
await client.send_message('me', 'Hello to myself!')
with client:
client.loop.run_until_complete(main())
You don’t need to import these AuthMethods
, MessageMethods
, etc.
Together they are the TelegramClient
and
you can access all of their methods.
See Client Reference for a short summary.