Objects Reference
This is the quick reference for those objects returned by client methods or other useful modules that the library has to offer. They are kept in a separate page to help finding and discovering them.
Remember that this page only shows properties and methods, not attributes. Make sure to open the full documentation to find out about the attributes.
ChatGetter
All events base ChatGetter
,
and some of the objects below do too, so it’s important to know its methods.
SenderGetter
Similar to ChatGetter
, a
SenderGetter
is the same,
but it works for senders instead.
Message
The Message
type is very important, mostly because we are working
with a library for a messaging platform, so messages are widely used:
in events, when fetching history, replies, etc.
It bases ChatGetter
and
SenderGetter
.
Properties
Note
We document custom properties here, not all the attributes of the
Message
(which is the information Telegram actually returns).
Methods
File
The File
type is a wrapper object
returned by Message.file
,
and you can use it to easily access a document’s attributes, such as
its name, bot-API style file ID, etc.
Conversation
The Conversation
object
is returned by the client.conversation()
method to easily
send and receive responses like a normal conversation.
It bases ChatGetter
.
AdminLogEvent
The AdminLogEvent
object
is returned by the client.iter_admin_log()
method to easily iterate
over past “events” (deleted messages, edits, title changes, leaving members…)
These are all the properties you can find in it:
InlineResult
The InlineResult
object
is returned inside a list by the client.inline_query()
method to make an inline
query to a bot that supports being used in inline mode, such as
@like.
Note that the list returned is in fact a subclass of a list called
InlineResults
, which,
in addition of being a list (iterator, indexed access, etc.), has extra
attributes and methods.
These are the constants for the types, properties and methods you can find the individual results:
Dialog
The Dialog
object is returned when
you call client.iter_dialogs()
.
Draft
The Draft
object is returned when
you call client.iter_drafts()
.
Utils
The telethon.utils
module has plenty of methods that make using the
library a lot easier. Only the interesting ones will be listed here.