mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-03-09 13:45:47 +03:00
Fix and update links in the documentation
This commit is contained in:
parent
fbf7f75b00
commit
5ac88f764d
|
@ -104,7 +104,7 @@ class DownloadMethods(UserMethods):
|
||||||
``cryptg`` (through ``pip install cryptg``) so that decrypting the
|
``cryptg`` (through ``pip install cryptg``) so that decrypting the
|
||||||
received data is done in C instead of Python (much faster).
|
received data is done in C instead of Python (much faster).
|
||||||
|
|
||||||
message (:tl:`Message` | :tl:`Media`):
|
message (`Message <telethon.tl.custom.message.Message>` | :tl:`Media`):
|
||||||
The media or message containing the media that will be downloaded.
|
The media or message containing the media that will be downloaded.
|
||||||
|
|
||||||
file (`str` | `file`, optional):
|
file (`str` | `file`, optional):
|
||||||
|
|
|
@ -349,8 +349,8 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
specified it makes sense that it should return the entirety of it.
|
specified it makes sense that it should return the entirety of it.
|
||||||
|
|
||||||
If `ids` is present in the *named* arguments and is not a list,
|
If `ids` is present in the *named* arguments and is not a list,
|
||||||
a single :tl:`Message` will be returned for convenience instead
|
a single `Message <telethon.tl.custom.message.Message>` will be
|
||||||
of a list.
|
returned for convenience instead of a list.
|
||||||
"""
|
"""
|
||||||
total = [0]
|
total = [0]
|
||||||
kwargs['_total'] = total
|
kwargs['_total'] = total
|
||||||
|
@ -397,7 +397,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
entity (`entity`):
|
entity (`entity`):
|
||||||
To who will it be sent.
|
To who will it be sent.
|
||||||
|
|
||||||
message (`str` | :tl:`Message`):
|
message (`str` | `Message <telethon.tl.custom.message.Message>`):
|
||||||
The message to be sent, or another message object to resend.
|
The message to be sent, or another message object to resend.
|
||||||
|
|
||||||
The maximum length for a message is 35,000 bytes or 4,096
|
The maximum length for a message is 35,000 bytes or 4,096
|
||||||
|
@ -405,13 +405,15 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
and you should slice them manually if the text to send is
|
and you should slice them manually if the text to send is
|
||||||
longer than said length.
|
longer than said length.
|
||||||
|
|
||||||
reply_to (`int` | :tl:`Message`, optional):
|
reply_to (`int` | `Message <telethon.tl.custom.message.Message>`, optional):
|
||||||
Whether to reply to a message or not. If an integer is provided,
|
Whether to reply to a message or not. If an integer is provided,
|
||||||
it should be the ID of the message that it should reply to.
|
it should be the ID of the message that it should reply to.
|
||||||
|
|
||||||
parse_mode (`object`, optional):
|
parse_mode (`object`, optional):
|
||||||
See the `TelegramClient.parse_mode` property for allowed
|
See the `TelegramClient.parse_mode
|
||||||
values. Markdown parsing will be used by default.
|
<telethon.client.messageparse.MessageParseMethods.parse_mode>`
|
||||||
|
property for allowed values. Markdown parsing will be used by
|
||||||
|
default.
|
||||||
|
|
||||||
link_preview (`bool`, optional):
|
link_preview (`bool`, optional):
|
||||||
Should the link preview be shown?
|
Should the link preview be shown?
|
||||||
|
@ -510,10 +512,9 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
|
|
||||||
result = await self(request)
|
result = await self(request)
|
||||||
if isinstance(result, types.UpdateShortSentMessage):
|
if isinstance(result, types.UpdateShortSentMessage):
|
||||||
to_id, cls = utils.resolve_id(utils.get_peer_id(entity))
|
|
||||||
message = types.Message(
|
message = types.Message(
|
||||||
id=result.id,
|
id=result.id,
|
||||||
to_id=cls(to_id),
|
to_id=utils.get_peer(entity),
|
||||||
message=message,
|
message=message,
|
||||||
date=result.date,
|
date=result.date,
|
||||||
out=result.out,
|
out=result.out,
|
||||||
|
@ -535,7 +536,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
entity (`entity`):
|
entity (`entity`):
|
||||||
To which entity the message(s) will be forwarded.
|
To which entity the message(s) will be forwarded.
|
||||||
|
|
||||||
messages (`list` | `int` | :tl:`Message`):
|
messages (`list` | `int` | `Message <telethon.tl.custom.message.Message>`):
|
||||||
The message(s) to forward, or their integer IDs.
|
The message(s) to forward, or their integer IDs.
|
||||||
|
|
||||||
from_peer (`entity`):
|
from_peer (`entity`):
|
||||||
|
@ -617,24 +618,28 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
Edits the given message ID (to change its contents or disable preview).
|
Edits the given message ID (to change its contents or disable preview).
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
entity (`entity` | :tl:`Message`):
|
entity (`entity` | `Message <telethon.tl.custom.message.Message>`):
|
||||||
From which chat to edit the message. This can also be
|
From which chat to edit the message. This can also be
|
||||||
the message to be edited, and the entity will be inferred
|
the message to be edited, and the entity will be inferred
|
||||||
from it, so the next parameter will be assumed to be the
|
from it, so the next parameter will be assumed to be the
|
||||||
message text.
|
message text.
|
||||||
|
|
||||||
message (`int` | :tl:`Message` | `str`):
|
message (`int` | `Message <telethon.tl.custom.message.Message>` | `str`):
|
||||||
The ID of the message (or :tl:`Message` itself) to be edited.
|
The ID of the message (or `Message
|
||||||
If the `entity` was a :tl:`Message`, then this message will be
|
<telethon.tl.custom.message.Message>` itself) to be edited.
|
||||||
treated as the new text.
|
If the `entity` was a `Message
|
||||||
|
<telethon.tl.custom.message.Message>`, then this message
|
||||||
|
will be treated as the new text.
|
||||||
|
|
||||||
text (`str`, optional):
|
text (`str`, optional):
|
||||||
The new text of the message. Does nothing if the `entity`
|
The new text of the message. Does nothing if the `entity`
|
||||||
was a :tl:`Message`.
|
was a `Message <telethon.tl.custom.message.Message>`.
|
||||||
|
|
||||||
parse_mode (`object`, optional):
|
parse_mode (`object`, optional):
|
||||||
See the `TelegramClient.parse_mode` property for allowed
|
See the `TelegramClient.parse_mode
|
||||||
values. Markdown parsing will be used by default.
|
<telethon.client.messageparse.MessageParseMethods.parse_mode>`
|
||||||
|
property for allowed values. Markdown parsing will be used by
|
||||||
|
default.
|
||||||
|
|
||||||
link_preview (`bool`, optional):
|
link_preview (`bool`, optional):
|
||||||
Should the link preview be shown?
|
Should the link preview be shown?
|
||||||
|
@ -701,7 +706,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
be ``None`` for normal chats, but **must** be present
|
be ``None`` for normal chats, but **must** be present
|
||||||
for channels and megagroups.
|
for channels and megagroups.
|
||||||
|
|
||||||
message_ids (`list` | `int` | :tl:`Message`):
|
message_ids (`list` | `int` | `Message <telethon.tl.custom.message.Message>`):
|
||||||
The IDs (or ID) or messages to be deleted.
|
The IDs (or ID) or messages to be deleted.
|
||||||
|
|
||||||
revoke (`bool`, optional):
|
revoke (`bool`, optional):
|
||||||
|
@ -751,7 +756,7 @@ class MessageMethods(UploadMethods, ButtonMethods, MessageParseMethods):
|
||||||
entity (`entity`):
|
entity (`entity`):
|
||||||
The chat where these messages are located.
|
The chat where these messages are located.
|
||||||
|
|
||||||
message (`list` | :tl:`Message`):
|
message (`list` | `Message <telethon.tl.custom.message.Message>`):
|
||||||
Either a list of messages or a single message.
|
Either a list of messages or a single message.
|
||||||
|
|
||||||
max_id (`int`):
|
max_id (`int`):
|
||||||
|
|
|
@ -68,7 +68,7 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
|
||||||
A callback function accepting two parameters:
|
A callback function accepting two parameters:
|
||||||
``(sent bytes, total)``.
|
``(sent bytes, total)``.
|
||||||
|
|
||||||
reply_to (`int` | :tl:`Message`):
|
reply_to (`int` | `Message <telethon.tl.custom.message.Message>`):
|
||||||
Same as `reply_to` from `send_message`.
|
Same as `reply_to` from `send_message`.
|
||||||
|
|
||||||
attributes (`list`, optional):
|
attributes (`list`, optional):
|
||||||
|
@ -90,8 +90,10 @@ class UploadMethods(ButtonMethods, MessageParseMethods, UserMethods):
|
||||||
or thumb than those that were used when the file was cached.
|
or thumb than those that were used when the file was cached.
|
||||||
|
|
||||||
parse_mode (`object`, optional):
|
parse_mode (`object`, optional):
|
||||||
See the `TelegramClient.parse_mode` property for allowed
|
See the `TelegramClient.parse_mode
|
||||||
values. Markdown parsing will be used by default.
|
<telethon.client.messageparse.MessageParseMethods.parse_mode>`
|
||||||
|
property for allowed values. Markdown parsing will be used by
|
||||||
|
default.
|
||||||
|
|
||||||
voice_note (`bool`, optional):
|
voice_note (`bool`, optional):
|
||||||
If ``True`` the audio will be sent as a voice note.
|
If ``True`` the audio will be sent as a voice note.
|
||||||
|
|
|
@ -232,7 +232,7 @@ class CallbackQuery(EventBuilder):
|
||||||
`telethon.client.messages.MessageMethods.edit_message` with
|
`telethon.client.messages.MessageMethods.edit_message` with
|
||||||
both ``entity`` and ``message`` already set.
|
both ``entity`` and ``message`` already set.
|
||||||
|
|
||||||
Returns the edited :tl:`Message`.
|
Returns the edited `Message <telethon.tl.custom.message.Message>`.
|
||||||
|
|
||||||
This method also creates a task to `answer` the callback.
|
This method also creates a task to `answer` the callback.
|
||||||
|
|
||||||
|
|
|
@ -20,11 +20,11 @@ class NewMessage(EventBuilder):
|
||||||
Mutually exclusive with ``incoming`` (can only set one of either).
|
Mutually exclusive with ``incoming`` (can only set one of either).
|
||||||
|
|
||||||
from_users (`entity`, optional):
|
from_users (`entity`, optional):
|
||||||
Unlike `chats`, this parameter filters the *sender* of the message.
|
Unlike `chats`, this parameter filters the *senders* of the
|
||||||
That is, only messages *sent by this user* will be handled. Use
|
message. That is, only messages *sent by these users* will be
|
||||||
`chats` if you want private messages with this/these users.
|
handled. Use `chats` if you want private messages with this/these
|
||||||
`from_users` lets you filter by messages sent by one or more users
|
users. `from_users` lets you filter by messages sent by *one or
|
||||||
across the desired chats.
|
more* users across the desired chats (doesn't need a list).
|
||||||
|
|
||||||
forwards (`bool`, optional):
|
forwards (`bool`, optional):
|
||||||
Whether forwarded messages should be handled or not. By default,
|
Whether forwarded messages should be handled or not. By default,
|
||||||
|
@ -162,7 +162,7 @@ class NewMessage(EventBuilder):
|
||||||
**refer to its documentation** to know what you can do with this event.
|
**refer to its documentation** to know what you can do with this event.
|
||||||
|
|
||||||
Members:
|
Members:
|
||||||
message (:tl:`Message`):
|
message (`Message <telethon.tl.custom.message.Message>`):
|
||||||
This is the only difference with the received
|
This is the only difference with the received
|
||||||
`telethon.tl.custom.message.Message`, and will
|
`telethon.tl.custom.message.Message`, and will
|
||||||
return the `telethon.tl.custom.message.Message` itself,
|
return the `telethon.tl.custom.message.Message` itself,
|
||||||
|
|
|
@ -112,7 +112,7 @@ class Conversation(ChatGetter):
|
||||||
Returns a coroutine that will resolve once a response arrives.
|
Returns a coroutine that will resolve once a response arrives.
|
||||||
|
|
||||||
Args:
|
Args:
|
||||||
message (:tl:`Message` | `int`, optional):
|
message (`Message <telethon.tl.custom.message.Message>` | `int`, optional):
|
||||||
The message (or the message ID) for which a response
|
The message (or the message ID) for which a response
|
||||||
is expected. By default this is the last sent message.
|
is expected. By default this is the last sent message.
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ class Dialog:
|
||||||
pinned (`bool`):
|
pinned (`bool`):
|
||||||
Whether this dialog is pinned to the top or not.
|
Whether this dialog is pinned to the top or not.
|
||||||
|
|
||||||
message (:tl:`Message`):
|
message (`Message <telethon.tl.custom.message.Message>`):
|
||||||
The last message sent on this dialog. Note that this member
|
The last message sent on this dialog. Note that this member
|
||||||
will not be updated when new messages arrive, it's only set
|
will not be updated when new messages arrive, it's only set
|
||||||
on creation of the instance.
|
on creation of the instance.
|
||||||
|
|
|
@ -106,7 +106,7 @@ class InlineResult:
|
||||||
entity (`entity`):
|
entity (`entity`):
|
||||||
The entity to which the message of this result should be sent.
|
The entity to which the message of this result should be sent.
|
||||||
|
|
||||||
reply_to (`int` | :tl:`Message`, optional):
|
reply_to (`int` | `Message <telethon.tl.custom.message.Message>`, optional):
|
||||||
If present, the sent message will reply to this ID or message.
|
If present, the sent message will reply to this ID or message.
|
||||||
|
|
||||||
silent (`bool`, optional):
|
silent (`bool`, optional):
|
||||||
|
|
|
@ -65,7 +65,8 @@ class Message(ChatGetter, SenderGetter, TLObject, abc.ABC):
|
||||||
messages.
|
messages.
|
||||||
|
|
||||||
message (`str`):
|
message (`str`):
|
||||||
The string text of the message for :tl:`Message` instances,
|
The string text of the message for `Message
|
||||||
|
<telethon.tl.custom.message.Message>` instances,
|
||||||
which will be ``None`` for other types of messages.
|
which will be ``None`` for other types of messages.
|
||||||
|
|
||||||
action (:tl:`MessageAction`):
|
action (:tl:`MessageAction`):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user