mirror of
https://github.com/aiogram/aiogram.git
synced 2026-04-08 16:37:47 +00:00
Bump Telegram Bot API version
Change request timeout mechanism Bump package version
This commit is contained in:
parent
b78f1cdb17
commit
7844a663a9
58 changed files with 526 additions and 369 deletions
|
|
@ -28,5 +28,5 @@ __all__ = (
|
|||
"handler",
|
||||
)
|
||||
|
||||
__version__ = "3.0.0a4"
|
||||
__api_version__ = "4.8"
|
||||
__version__ = "3.0.0a5"
|
||||
__api_version__ = "4.9"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -125,16 +125,16 @@ class AiohttpSession(BaseSession):
|
|||
form.add_field(key, value, filename=value.filename or key)
|
||||
return form
|
||||
|
||||
async def make_request(self, token: str, call: TelegramMethod[T]) -> T:
|
||||
async def make_request(
|
||||
self, token: str, call: TelegramMethod[T], timeout: Optional[int] = None
|
||||
) -> T:
|
||||
session = await self.create_session()
|
||||
|
||||
request = call.build_request()
|
||||
url = self.api.api_url(token=token, method=request.method)
|
||||
form = self.build_form_data(request)
|
||||
|
||||
async with session.post(
|
||||
url, data=form, timeout=call.request_timeout or self.timeout
|
||||
) as resp:
|
||||
async with session.post(url, data=form, timeout=timeout or self.timeout) as resp:
|
||||
raw_result = await resp.json(loads=self.json_loads)
|
||||
|
||||
response = call.build_response(raw_result)
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ from aiogram.utils.exceptions import TelegramAPIError
|
|||
|
||||
from ....utils.helper import Default
|
||||
from ...methods import Response, TelegramMethod
|
||||
from ...types import UNSET
|
||||
from ..telegram import PRODUCTION, TelegramAPIServer
|
||||
|
||||
T = TypeVar("T")
|
||||
|
|
@ -18,9 +19,7 @@ _JsonDumps = Callable[..., str]
|
|||
|
||||
|
||||
class BaseSession(abc.ABC):
|
||||
# global session timeout
|
||||
default_timeout: ClassVar[float] = 60.0
|
||||
|
||||
api: Default[TelegramAPIServer] = Default(PRODUCTION)
|
||||
json_loads: Default[_JsonLoads] = Default(json.loads)
|
||||
json_dumps: Default[_JsonDumps] = Default(json.dumps)
|
||||
|
|
@ -37,7 +36,9 @@ class BaseSession(abc.ABC):
|
|||
pass
|
||||
|
||||
@abc.abstractmethod
|
||||
async def make_request(self, token: str, method: TelegramMethod[T]) -> T: # pragma: no cover
|
||||
async def make_request(
|
||||
self, token: str, method: TelegramMethod[T], timeout: Optional[int] = UNSET
|
||||
) -> T: # pragma: no cover
|
||||
pass
|
||||
|
||||
@abc.abstractmethod
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ class AnswerInlineQuery(TelegramMethod[bool]):
|
|||
query. By default, results may be returned to any user who sends the same query"""
|
||||
next_offset: Optional[str] = None
|
||||
"""Pass the offset that a client should send in the next query with the same text to receive
|
||||
more results. Pass an empty string if there are no more results or if you don‘t support
|
||||
pagination. Offset length can’t exceed 64 bytes."""
|
||||
more results. Pass an empty string if there are no more results or if you don't support
|
||||
pagination. Offset length can't exceed 64 bytes."""
|
||||
switch_pm_text: Optional[str] = None
|
||||
"""If passed, clients will display a button with specified text that switches the user to a
|
||||
private chat with the bot and sends the bot a start message with the parameter
|
||||
|
|
|
|||
|
|
@ -69,13 +69,9 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[T]):
|
|||
def build_request(self) -> Request: # pragma: no cover
|
||||
pass
|
||||
|
||||
request_timeout: Optional[float] = None
|
||||
|
||||
def dict(self, **kwargs: Any) -> Any:
|
||||
# override dict of pydantic.BaseModel to overcome exporting request_timeout field
|
||||
exclude = kwargs.pop("exclude", set())
|
||||
if isinstance(exclude, set):
|
||||
exclude.add("request_timeout")
|
||||
|
||||
return super().dict(exclude=exclude, **kwargs)
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ class EditMessageCaption(TelegramMethod[Union[Message, bool]]):
|
|||
caption: Optional[str] = None
|
||||
"""New caption of the message, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the message caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an inline keyboard."""
|
||||
|
||||
|
|
|
|||
|
|
@ -24,8 +24,7 @@ class EditMessageText(TelegramMethod[Union[Message, bool]]):
|
|||
inline_message_id: Optional[str] = None
|
||||
"""Required if chat_id and message_id are not specified. Identifier of the inline message"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in your bot's message."""
|
||||
"""Mode for parsing entities in the message text. See formatting options for more details."""
|
||||
disable_web_page_preview: Optional[bool] = None
|
||||
"""Disables link previews for links in this message"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ from .base import Request, TelegramMethod
|
|||
class PinChatMessage(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to pin a message in a group, a supergroup, or a channel. The bot must be an
|
||||
administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in
|
||||
the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
|
||||
administrator in the chat for this to work and must have the 'can_pin_messages' admin right in
|
||||
the supergroup or 'can_edit_messages' admin right in the channel. Returns True on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#pinchatmessage
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -39,16 +39,16 @@ class SendAnimation(TelegramMethod[Message]):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Animation caption (may also be used when resending animation by file_id), 0-1024 characters
|
||||
after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the animation caption. See formatting options for more
|
||||
details."""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message silently. Users will receive a notification with no sound."""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -35,8 +35,7 @@ class SendAudio(TelegramMethod[Message]):
|
|||
caption: Optional[str] = None
|
||||
"""Audio caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the audio caption. See formatting options for more details."""
|
||||
duration: Optional[int] = None
|
||||
"""Duration of the audio in seconds"""
|
||||
performer: Optional[str] = None
|
||||
|
|
@ -46,8 +45,8 @@ class SendAudio(TelegramMethod[Message]):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
disable_notification: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -12,9 +12,8 @@ from .base import Request, TelegramMethod
|
|||
|
||||
class SendDice(TelegramMethod[Message]):
|
||||
"""
|
||||
Use this method to send a dice, which will have a random value from 1 to 6. On success, the
|
||||
sent Message is returned. (Yes, we're aware of the 'proper' singular of die. But it's awkward,
|
||||
and we decided to help it change. One dice at a time!)
|
||||
Use this method to send an animated emoji that will display a random value. On success, the
|
||||
sent Message is returned.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#senddice
|
||||
"""
|
||||
|
|
@ -25,8 +24,8 @@ class SendDice(TelegramMethod[Message]):
|
|||
"""Unique identifier for the target chat or username of the target channel (in the format
|
||||
@channelusername)"""
|
||||
emoji: Optional[str] = None
|
||||
"""Emoji on which the dice throw animation is based. Currently, must be one of '' or ''.
|
||||
Defauts to ''"""
|
||||
"""Emoji on which the dice throw animation is based. Currently, must be one of '', '', or ''.
|
||||
Dice can have values 1-6 for '' and '', and values 1-5 for ''. Defaults to ''"""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message silently. Users will receive a notification with no sound."""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -33,16 +33,15 @@ class SendDocument(TelegramMethod[Message]):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Document caption (may also be used when resending documents by file_id), 0-1024 characters
|
||||
after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the document caption. See formatting options for more details."""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message silently. Users will receive a notification with no sound."""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ class SendGame(TelegramMethod[Message]):
|
|||
reply_to_message_id: Optional[int] = None
|
||||
"""If the message is a reply, ID of the original message"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""A JSON-serialized object for an inline keyboard. If empty, one ‘Play game_title’ button
|
||||
"""A JSON-serialized object for an inline keyboard. If empty, one 'Play game_title' button
|
||||
will be shown. If not empty, the first button must launch the game."""
|
||||
|
||||
def build_request(self) -> Request:
|
||||
|
|
|
|||
|
|
@ -26,8 +26,7 @@ class SendMessage(TelegramMethod[Message]):
|
|||
text: str
|
||||
"""Text of the message to be sent, 1-4096 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in your bot's message."""
|
||||
"""Mode for parsing entities in the message text. See formatting options for more details."""
|
||||
disable_web_page_preview: Optional[bool] = None
|
||||
"""Disables link previews for links in this message"""
|
||||
disable_notification: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ class SendPhoto(TelegramMethod[Message]):
|
|||
"""Photo caption (may also be used when resending photos by file_id), 0-1024 characters after
|
||||
entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the photo caption. See formatting options for more details."""
|
||||
disable_notification: Optional[bool] = None
|
||||
"""Sends the message silently. Users will receive a notification with no sound."""
|
||||
reply_to_message_id: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -39,16 +39,15 @@ class SendVideo(TelegramMethod[Message]):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Video caption (may also be used when resending videos by file_id), 0-1024 characters after
|
||||
entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the video caption. See formatting options for more details."""
|
||||
supports_streaming: Optional[bool] = None
|
||||
"""Pass True, if the uploaded video is suitable for streaming"""
|
||||
disable_notification: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class SendVideoNote(TelegramMethod[Message]):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
disable_notification: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class SendVoice(TelegramMethod[Message]):
|
|||
caption: Optional[str] = None
|
||||
"""Voice message caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the voice message caption. See formatting options for more
|
||||
details."""
|
||||
duration: Optional[int] = None
|
||||
"""Duration of the voice message in seconds"""
|
||||
disable_notification: Optional[bool] = None
|
||||
|
|
|
|||
|
|
@ -12,7 +12,7 @@ class SetWebhook(TelegramMethod[bool]):
|
|||
after a reasonable amount of attempts. Returns True on success.
|
||||
If you'd like to make sure that the Webhook request comes from Telegram, we recommend using a
|
||||
secret path in the URL, e.g. https://www.example.com/<token>. Since nobody else knows your
|
||||
bot‘s token, you can be pretty sure it’s us.
|
||||
bot's token, you can be pretty sure it's us.
|
||||
Notes
|
||||
1. You will not be able to receive updates using getUpdates for as long as an outgoing webhook
|
||||
is set up.
|
||||
|
|
@ -34,8 +34,8 @@ class SetWebhook(TelegramMethod[bool]):
|
|||
our self-signed guide for details."""
|
||||
max_connections: Optional[int] = None
|
||||
"""Maximum allowed number of simultaneous HTTPS connections to the webhook for update
|
||||
delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot‘s server,
|
||||
and higher values to increase your bot’s throughput."""
|
||||
delivery, 1-100. Defaults to 40. Use lower values to limit the load on your bot's server,
|
||||
and higher values to increase your bot's throughput."""
|
||||
allowed_updates: Optional[List[str]] = None
|
||||
"""A JSON-serialized list of the update types you want your bot to receive. For example,
|
||||
specify ['message', 'edited_channel_post', 'callback_query'] to only receive updates of
|
||||
|
|
|
|||
|
|
@ -6,8 +6,8 @@ from .base import Request, TelegramMethod
|
|||
class UnpinChatMessage(TelegramMethod[bool]):
|
||||
"""
|
||||
Use this method to unpin a message in a group, a supergroup, or a channel. The bot must be an
|
||||
administrator in the chat for this to work and must have the ‘can_pin_messages’ admin right in
|
||||
the supergroup or ‘can_edit_messages’ admin right in the channel. Returns True on success.
|
||||
administrator in the chat for this to work and must have the 'can_pin_messages' admin right in
|
||||
the supergroup or 'can_edit_messages' admin right in the channel. Returns True on success.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#unpinchatmessage
|
||||
"""
|
||||
|
|
|
|||
|
|
@ -24,4 +24,3 @@ class MutableTelegramObject(TelegramObject):
|
|||
|
||||
|
||||
UNSET: Any = sentinel.UNSET # special sentinel object which used in sutuation when None might be a useful value
|
||||
print(id(UNSET))
|
||||
|
|
|
|||
|
|
@ -3,8 +3,8 @@ from __future__ import annotations
|
|||
import datetime
|
||||
from typing import TYPE_CHECKING, Optional, Union
|
||||
|
||||
from .base import TelegramObject
|
||||
from ...utils import helper
|
||||
from .base import TelegramObject
|
||||
|
||||
if TYPE_CHECKING: # pragma: no cover
|
||||
from .user import User
|
||||
|
|
@ -80,6 +80,7 @@ class ChatMemberStatus(helper.Helper):
|
|||
"""
|
||||
Chat member status
|
||||
"""
|
||||
|
||||
mode = helper.HelperMode.lowercase
|
||||
|
||||
CREATOR = helper.Item() # creator
|
||||
|
|
|
|||
|
|
@ -5,9 +5,7 @@ from .base import TelegramObject
|
|||
|
||||
class Dice(TelegramObject):
|
||||
"""
|
||||
This object represents a dice with a random value from 1 to 6 for currently supported base
|
||||
emoji. (Yes, we're aware of the 'proper' singular of die. But it's awkward, and we decided to
|
||||
help it change. One dice at a time!)
|
||||
This object represents an animated emoji that displays a random value.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#dice
|
||||
"""
|
||||
|
|
@ -15,7 +13,7 @@ class Dice(TelegramObject):
|
|||
emoji: str
|
||||
"""Emoji on which the dice throw animation is based"""
|
||||
value: int
|
||||
"""Value of the dice, 1-6 for currently supported base emoji"""
|
||||
"""Value of the dice, 1-6 for '' and '' base emoji, 1-5 for '' base emoji"""
|
||||
|
||||
|
||||
class DiceEmoji:
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@ from .base import MutableTelegramObject
|
|||
class ForceReply(MutableTelegramObject):
|
||||
"""
|
||||
Upon receiving a message with this object, Telegram clients will display a reply interface to
|
||||
the user (act as if the user has selected the bot‘s message and tapped ’Reply'). This can be
|
||||
the user (act as if the user has selected the bot's message and tapped 'Reply'). This can be
|
||||
extremely useful if you want to create user-friendly step-by-step interfaces without having to
|
||||
sacrifice privacy mode.
|
||||
Example: A poll bot for groups runs in privacy mode (only receives commands, replies to its
|
||||
|
|
@ -16,19 +16,19 @@ class ForceReply(MutableTelegramObject):
|
|||
|
||||
Explain the user how to send a command with parameters (e.g. /newpoll question answer1
|
||||
answer2). May be appealing for hardcore users but lacks modern day polish.
|
||||
Guide the user through a step-by-step process. ‘Please send me your question’, ‘Cool, now
|
||||
let’s add the first answer option‘, ’Great. Keep adding answer options, then send /done when
|
||||
you‘re ready’.
|
||||
The last option is definitely more attractive. And if you use ForceReply in your bot‘s
|
||||
questions, it will receive the user’s answers even if it only receives replies, commands and
|
||||
Guide the user through a step-by-step process. 'Please send me your question', 'Cool, now
|
||||
let's add the first answer option', 'Great. Keep adding answer options, then send /done when
|
||||
you're ready'.
|
||||
The last option is definitely more attractive. And if you use ForceReply in your bot's
|
||||
questions, it will receive the user's answers even if it only receives replies, commands and
|
||||
mentions — without any extra work for the user.
|
||||
|
||||
Source: https://core.telegram.org/bots/api#forcereply
|
||||
"""
|
||||
|
||||
force_reply: bool
|
||||
"""Shows reply interface to the user, as if they manually selected the bot‘s message and
|
||||
tapped ’Reply'"""
|
||||
"""Shows reply interface to the user, as if they manually selected the bot's message and
|
||||
tapped 'Reply'"""
|
||||
selective: Optional[bool] = None
|
||||
"""Use this parameter if you want to force reply from specific users only. Targets: 1) users
|
||||
that are @mentioned in the text of the Message object; 2) if the bot's message is a reply
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ if TYPE_CHECKING: # pragma: no cover
|
|||
class GameHighScore(TelegramObject):
|
||||
"""
|
||||
This object represents one row of the high scores table for a game.
|
||||
And that‘s about all we’ve got for now.
|
||||
And that's about all we've got for now.
|
||||
If you've got any questions, please check out our Bot FAQ
|
||||
|
||||
Source: https://core.telegram.org/bots/api#gamehighscore
|
||||
|
|
|
|||
|
|
@ -28,11 +28,11 @@ class InlineKeyboardButton(MutableTelegramObject):
|
|||
"""Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes"""
|
||||
switch_inline_query: Optional[str] = None
|
||||
"""If set, pressing the button will prompt the user to select one of their chats, open that
|
||||
chat and insert the bot‘s username and the specified inline query in the input field. Can
|
||||
be empty, in which case just the bot’s username will be inserted."""
|
||||
chat and insert the bot's username and the specified inline query in the input field. Can
|
||||
be empty, in which case just the bot's username will be inserted."""
|
||||
switch_inline_query_current_chat: Optional[str] = None
|
||||
"""If set, pressing the button will insert the bot‘s username and the specified inline query
|
||||
in the current chat’s input field. Can be empty, in which case only the bot's username will
|
||||
"""If set, pressing the button will insert the bot's username and the specified inline query
|
||||
in the current chat's input field. Can be empty, in which case only the bot's username will
|
||||
be inserted."""
|
||||
callback_game: Optional[CallbackGame] = None
|
||||
"""Description of the game that will be launched when the user presses the button."""
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ class InlineQueryResultAudio(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the audio caption. See formatting options for more details."""
|
||||
performer: Optional[str] = None
|
||||
"""Performer"""
|
||||
audio_duration: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ class InlineQueryResultCachedAudio(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the audio caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -36,8 +36,7 @@ class InlineQueryResultCachedDocument(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the document caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -32,8 +32,7 @@ class InlineQueryResultCachedGif(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the GIF file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -33,8 +33,7 @@ class InlineQueryResultCachedMpeg4Gif(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ class InlineQueryResultCachedPhoto(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the photo caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -34,8 +34,7 @@ class InlineQueryResultCachedVideo(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the video caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -34,8 +34,8 @@ class InlineQueryResultCachedVoice(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the voice message caption. See formatting options for more
|
||||
details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -37,8 +37,7 @@ class InlineQueryResultDocument(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the document caption. See formatting options for more details."""
|
||||
description: Optional[str] = None
|
||||
"""Short description of the result"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
|
|
|
|||
|
|
@ -28,20 +28,22 @@ class InlineQueryResultGif(InlineQueryResult):
|
|||
gif_url: str
|
||||
"""A valid URL for the GIF file. File size must not exceed 1MB"""
|
||||
thumb_url: str
|
||||
"""URL of the static thumbnail for the result (jpeg or gif)"""
|
||||
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
|
||||
gif_width: Optional[int] = None
|
||||
"""Width of the GIF"""
|
||||
gif_height: Optional[int] = None
|
||||
"""Height of the GIF"""
|
||||
gif_duration: Optional[int] = None
|
||||
"""Duration of the GIF"""
|
||||
thumb_mime_type: Optional[str] = None
|
||||
"""MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'.
|
||||
Defaults to 'image/jpeg'"""
|
||||
title: Optional[str] = None
|
||||
"""Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""Caption of the GIF file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -29,20 +29,22 @@ class InlineQueryResultMpeg4Gif(InlineQueryResult):
|
|||
mpeg4_url: str
|
||||
"""A valid URL for the MP4 file. File size must not exceed 1MB"""
|
||||
thumb_url: str
|
||||
"""URL of the static thumbnail (jpeg or gif) for the result"""
|
||||
"""URL of the static (JPEG or GIF) or animated (MPEG4) thumbnail for the result"""
|
||||
mpeg4_width: Optional[int] = None
|
||||
"""Video width"""
|
||||
mpeg4_height: Optional[int] = None
|
||||
"""Video height"""
|
||||
mpeg4_duration: Optional[int] = None
|
||||
"""Video duration"""
|
||||
thumb_mime_type: Optional[str] = None
|
||||
"""MIME type of the thumbnail, must be one of 'image/jpeg', 'image/gif', or 'video/mp4'.
|
||||
Defaults to 'image/jpeg'"""
|
||||
title: Optional[str] = None
|
||||
"""Title for the result"""
|
||||
caption: Optional[str] = None
|
||||
"""Caption of the MPEG-4 file to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -40,8 +40,7 @@ class InlineQueryResultPhoto(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the photo caption. See formatting options for more details."""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
"""Inline keyboard attached to the message"""
|
||||
input_message_content: Optional[InputMessageContent] = None
|
||||
|
|
|
|||
|
|
@ -38,8 +38,7 @@ class InlineQueryResultVideo(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the video caption. See formatting options for more details."""
|
||||
video_width: Optional[int] = None
|
||||
"""Video width"""
|
||||
video_height: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -35,8 +35,8 @@ class InlineQueryResultVoice(InlineQueryResult):
|
|||
caption: Optional[str] = None
|
||||
"""Caption, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the voice message caption. See formatting options for more
|
||||
details."""
|
||||
voice_duration: Optional[int] = None
|
||||
"""Recording duration in seconds"""
|
||||
reply_markup: Optional[InlineKeyboardMarkup] = None
|
||||
|
|
|
|||
|
|
@ -28,15 +28,15 @@ class InputMediaAnimation(InputMedia):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Caption of the animation to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the animation caption. See formatting options for more
|
||||
details."""
|
||||
width: Optional[int] = None
|
||||
"""Animation width"""
|
||||
height: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -28,15 +28,14 @@ class InputMediaAudio(InputMedia):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Caption of the audio to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the audio caption. See formatting options for more details."""
|
||||
duration: Optional[int] = None
|
||||
"""Duration of the audio in seconds"""
|
||||
performer: Optional[str] = None
|
||||
|
|
|
|||
|
|
@ -28,12 +28,11 @@ class InputMediaDocument(InputMedia):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Caption of the document to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the document caption. See formatting options for more details."""
|
||||
|
|
|
|||
|
|
@ -28,5 +28,4 @@ class InputMediaPhoto(InputMedia):
|
|||
caption: Optional[str] = None
|
||||
"""Caption of the photo to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the photo caption. See formatting options for more details."""
|
||||
|
|
|
|||
|
|
@ -28,15 +28,14 @@ class InputMediaVideo(InputMedia):
|
|||
thumb: Optional[Union[InputFile, str]] = None
|
||||
"""Thumbnail of the file sent; can be ignored if thumbnail generation for the file is
|
||||
supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size.
|
||||
A thumbnail‘s width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new
|
||||
A thumbnail's width and height should not exceed 320. Ignored if the file is not uploaded
|
||||
using multipart/form-data. Thumbnails can't be reused and can be only uploaded as a new
|
||||
file, so you can pass 'attach://<file_attach_name>' if the thumbnail was uploaded using
|
||||
multipart/form-data under <file_attach_name>."""
|
||||
caption: Optional[str] = None
|
||||
"""Caption of the video to be sent, 0-1024 characters after entities parsing"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in the media caption."""
|
||||
"""Mode for parsing entities in the video caption. See formatting options for more details."""
|
||||
width: Optional[int] = None
|
||||
"""Video width"""
|
||||
height: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -16,7 +16,6 @@ class InputTextMessageContent(InputMessageContent):
|
|||
message_text: str
|
||||
"""Text of the message to be sent, 1-4096 characters"""
|
||||
parse_mode: Optional[str] = UNSET
|
||||
"""Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or
|
||||
inline URLs in your bot's message."""
|
||||
"""Mode for parsing entities in the message text. See formatting options for more details."""
|
||||
disable_web_page_preview: Optional[bool] = None
|
||||
"""Disables link previews for links in the sent message"""
|
||||
|
|
|
|||
|
|
@ -90,6 +90,8 @@ class Message(TelegramObject):
|
|||
reply_to_message: Optional[Message] = None
|
||||
"""For replies, the original message. Note that the Message object in this field will not
|
||||
contain further reply_to_message fields even if it itself is a reply."""
|
||||
via_bot: Optional[User] = None
|
||||
"""Bot through which the message was sent"""
|
||||
edit_date: Optional[int] = None
|
||||
"""Date the message was last edited in Unix time"""
|
||||
media_group_id: Optional[str] = None
|
||||
|
|
@ -101,40 +103,41 @@ class Message(TelegramObject):
|
|||
entities: Optional[List[MessageEntity]] = None
|
||||
"""For text messages, special entities like usernames, URLs, bot commands, etc. that appear in
|
||||
the text"""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""For messages with a caption, special entities like usernames, URLs, bot commands, etc. that
|
||||
appear in the caption"""
|
||||
animation: Optional[Animation] = None
|
||||
"""Message is an animation, information about the animation. For backward compatibility, when
|
||||
this field is set, the document field will also be set"""
|
||||
audio: Optional[Audio] = None
|
||||
"""Message is an audio file, information about the file"""
|
||||
document: Optional[Document] = None
|
||||
"""Message is a general file, information about the file"""
|
||||
animation: Optional[Animation] = None
|
||||
"""Message is an animation, information about the animation. For backward compatibility, when
|
||||
this field is set, the document field will also be set"""
|
||||
game: Optional[Game] = None
|
||||
"""Message is a game, information about the game."""
|
||||
photo: Optional[List[PhotoSize]] = None
|
||||
"""Message is a photo, available sizes of the photo"""
|
||||
sticker: Optional[Sticker] = None
|
||||
"""Message is a sticker, information about the sticker"""
|
||||
video: Optional[Video] = None
|
||||
"""Message is a video, information about the video"""
|
||||
voice: Optional[Voice] = None
|
||||
"""Message is a voice message, information about the file"""
|
||||
video_note: Optional[VideoNote] = None
|
||||
"""Message is a video note, information about the video message"""
|
||||
voice: Optional[Voice] = None
|
||||
"""Message is a voice message, information about the file"""
|
||||
caption: Optional[str] = None
|
||||
"""Caption for the animation, audio, document, photo, video or voice, 0-1024 characters"""
|
||||
caption_entities: Optional[List[MessageEntity]] = None
|
||||
"""For messages with a caption, special entities like usernames, URLs, bot commands, etc. that
|
||||
appear in the caption"""
|
||||
contact: Optional[Contact] = None
|
||||
"""Message is a shared contact, information about the contact"""
|
||||
location: Optional[Location] = None
|
||||
"""Message is a shared location, information about the location"""
|
||||
venue: Optional[Venue] = None
|
||||
"""Message is a venue, information about the venue"""
|
||||
poll: Optional[Poll] = None
|
||||
"""Message is a native poll, information about the poll"""
|
||||
dice: Optional[Dice] = None
|
||||
"""Message is a dice with random value from 1 to 6"""
|
||||
game: Optional[Game] = None
|
||||
"""Message is a game, information about the game."""
|
||||
poll: Optional[Poll] = None
|
||||
"""Message is a native poll, information about the poll"""
|
||||
venue: Optional[Venue] = None
|
||||
"""Message is a venue, information about the venue. For backward compatibility, when this
|
||||
field is set, the location field will also be set"""
|
||||
location: Optional[Location] = None
|
||||
"""Message is a shared location, information about the location"""
|
||||
new_chat_members: Optional[List[User]] = None
|
||||
"""New members that were added to the group or supergroup and information about them (the bot
|
||||
itself may be one of these members)"""
|
||||
|
|
@ -150,13 +153,13 @@ class Message(TelegramObject):
|
|||
group_chat_created: Optional[bool] = None
|
||||
"""Service message: the group has been created"""
|
||||
supergroup_chat_created: Optional[bool] = None
|
||||
"""Service message: the supergroup has been created. This field can‘t be received in a message
|
||||
coming through updates, because bot can’t be a member of a supergroup when it is created.
|
||||
"""Service message: the supergroup has been created. This field can't be received in a message
|
||||
coming through updates, because bot can't be a member of a supergroup when it is created.
|
||||
It can only be found in reply_to_message if someone replies to a very first message in a
|
||||
directly created supergroup."""
|
||||
channel_chat_created: Optional[bool] = None
|
||||
"""Service message: the channel has been created. This field can‘t be received in a message
|
||||
coming through updates, because bot can’t be a member of a channel when it is created. It
|
||||
"""Service message: the channel has been created. This field can't be received in a message
|
||||
coming through updates, because bot can't be a member of a channel when it is created. It
|
||||
can only be found in reply_to_message if someone replies to a very first message in a
|
||||
channel."""
|
||||
migrate_to_chat_id: Optional[int] = None
|
||||
|
|
|
|||
|
|
@ -24,8 +24,8 @@ class Update(TelegramObject):
|
|||
"""
|
||||
|
||||
update_id: int
|
||||
"""The update‘s unique identifier. Update identifiers start from a certain positive number and
|
||||
increase sequentially. This ID becomes especially handy if you’re using Webhooks, since it
|
||||
"""The update's unique identifier. Update identifiers start from a certain positive number and
|
||||
increase sequentially. This ID becomes especially handy if you're using Webhooks, since it
|
||||
allows you to ignore repeated updates or to restore the correct update sequence, should
|
||||
they get out of order. If there are no new updates for at least a week, then identifier of
|
||||
the next update will be chosen randomly instead of sequentially."""
|
||||
|
|
|
|||
|
|
@ -17,11 +17,11 @@ class User(TelegramObject):
|
|||
is_bot: bool
|
||||
"""True, if this user is a bot"""
|
||||
first_name: str
|
||||
"""User‘s or bot’s first name"""
|
||||
"""User's or bot's first name"""
|
||||
last_name: Optional[str] = None
|
||||
"""User‘s or bot’s last name"""
|
||||
"""User's or bot's last name"""
|
||||
username: Optional[str] = None
|
||||
"""User‘s or bot’s username"""
|
||||
"""User's or bot's username"""
|
||||
language_code: Optional[str] = None
|
||||
"""IETF language tag of the user's language"""
|
||||
can_join_groups: Optional[bool] = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue