Merge remote-tracking branch 'origin/dev-3.x' into dev-3.x

This commit is contained in:
jrootjunior 2020-01-13 16:09:17 +02:00
commit fa979c96e5
159 changed files with 1409 additions and 1055 deletions

View file

@ -4,6 +4,8 @@ base_python := python3
py := poetry run py := poetry run
python := $(py) python python := $(py) python
reports_dir := reports
.PHONY: help .PHONY: help
help: help:
@echo "=======================================================================================" @echo "======================================================================================="
@ -79,8 +81,8 @@ flake8:
.PHONY: flake8-report .PHONY: flake8-report
flake8-report: flake8-report:
mkdir -p reports/flake8 mkdir -p $(reports_dir)/flake8
$(py) flake8 --format=html --htmldir=reports/flake8 aiogram test $(py) flake8 --format=html --htmldir=$(reports_dir)/flake8 aiogram test
.PHONY: mypy .PHONY: mypy
mypy: mypy:
@ -88,7 +90,7 @@ mypy:
.PHONY: mypy-report .PHONY: mypy-report
mypy-report: mypy-report:
$(py) mypy aiogram tests --html-report reports/typechecking $(py) mypy aiogram tests --html-report $(reports_dir)/typechecking
.PHONY: lint .PHONY: lint
lint: isort black flake8 mypy lint: isort black flake8 mypy
@ -99,13 +101,13 @@ lint: isort black flake8 mypy
.PHONY: test .PHONY: test
test: test:
$(py) pytest --cov=aiogram --cov-config .coveragerc -p no:warnings tests/ $(py) pytest --cov=aiogram --cov-config .coveragerc tests/
.PHONY: test-coverage .PHONY: test-coverage
test-coverage: test-coverage:
mkdir -p reports/tests/ mkdir -p $(reports_dir)/tests/
$(py) pytest --cov=aiogram --cov-config .coveragerc --html=reports/tests/index.html -p no:warnings tests/ $(py) pytest --cov=aiogram --cov-config .coveragerc --html=$(reports_dir)/tests/index.html tests/
$(py) coverage html -d reports/coverage $(py) coverage html -d $(reports_dir)/coverage
# ================================================================================================= # =================================================================================================
# Docs # Docs
@ -121,7 +123,7 @@ docs-serve:
.PHONY: docs-copy-reports .PHONY: docs-copy-reports
docs-copy-reports: docs-copy-reports:
mv reports/* site/reports mv $(reports_dir)/* site/reports
# ================================================================================================= # =================================================================================================
@ -129,7 +131,7 @@ docs-copy-reports:
# ================================================================================================= # =================================================================================================
.PHONY: build .PHONY: build
build: clean tests test-coverage flake8-report mypy-report docs docs-copy-reports build: clean flake8-report mypy-report test-coverage docs docs-copy-reports
mkdir -p site/simple mkdir -p site/simple
poetry build poetry build
mv dist site/simple/aiogram mv dist site/simple/aiogram

View file

@ -2,7 +2,7 @@
[![MIT License](https://img.shields.io/pypi/l/aiogram.svg?style=flat-square)](https://opensource.org/licenses/MIT) [![MIT License](https://img.shields.io/pypi/l/aiogram.svg?style=flat-square)](https://opensource.org/licenses/MIT)
[![Supported python versions](https://img.shields.io/pypi/pyversions/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram) [![Supported python versions](https://img.shields.io/pypi/pyversions/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram)
[![Telegram Bot API](https://img.shields.io/badge/Telegram%20Bot%20API-4.4-blue.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api) [![Telegram Bot API](https://img.shields.io/badge/Telegram%20Bot%20API-4.5-blue.svg?style=flat-square&logo=telegram)](https://core.telegram.org/bots/api)
[![PyPi Package Version](https://img.shields.io/pypi/v/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram) [![PyPi Package Version](https://img.shields.io/pypi/v/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram)
[![PyPi status](https://img.shields.io/pypi/status/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram) [![PyPi status](https://img.shields.io/pypi/status/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram)
[![Downloads](https://img.shields.io/pypi/dm/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram) [![Downloads](https://img.shields.io/pypi/dm/aiogram.svg?style=flat-square)](https://pypi.python.org/pypi/aiogram)

View file

@ -26,5 +26,5 @@ __all__ = (
"handler", "handler",
) )
__version__ = "3.0.0a0" __version__ = "3.0.0a1"
__api_version__ = "4.4" __api_version__ = "4.5"

View file

@ -38,7 +38,7 @@ class BaseBot(ContextInstanceMixin, DataMixin):
""" """
return extract_bot_id(self.__token) return extract_bot_id(self.__token)
async def emit(self, method: TelegramMethod[T]) -> T: async def __call__(self, method: TelegramMethod[T]) -> T:
""" """
Call API method Call API method

View file

@ -55,6 +55,7 @@ from ..methods import (
SendVideo, SendVideo,
SendVideoNote, SendVideoNote,
SendVoice, SendVoice,
SetChatAdministratorCustomTitle,
SetChatDescription, SetChatDescription,
SetChatPermissions, SetChatPermissions,
SetChatPhoto, SetChatPhoto,
@ -154,7 +155,7 @@ class Bot(BaseBot):
call = GetUpdates( call = GetUpdates(
offset=offset, limit=limit, timeout=timeout, allowed_updates=allowed_updates offset=offset, limit=limit, timeout=timeout, allowed_updates=allowed_updates
) )
return await self.emit(call) return await self(call)
async def set_webhook( async def set_webhook(
self, self,
@ -204,7 +205,7 @@ class Bot(BaseBot):
max_connections=max_connections, max_connections=max_connections,
allowed_updates=allowed_updates, allowed_updates=allowed_updates,
) )
return await self.emit(call) return await self(call)
async def delete_webhook(self,) -> bool: async def delete_webhook(self,) -> bool:
""" """
@ -216,7 +217,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = DeleteWebhook() call = DeleteWebhook()
return await self.emit(call) return await self(call)
async def get_webhook_info(self,) -> WebhookInfo: async def get_webhook_info(self,) -> WebhookInfo:
""" """
@ -230,7 +231,7 @@ class Bot(BaseBot):
return an object with the url field empty. return an object with the url field empty.
""" """
call = GetWebhookInfo() call = GetWebhookInfo()
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Available methods # Group: Available methods
@ -247,7 +248,7 @@ class Bot(BaseBot):
:return: Returns basic information about the bot in form of a User object. :return: Returns basic information about the bot in form of a User object.
""" """
call = GetMe() call = GetMe()
return await self.emit(call) return await self(call)
async def send_message( async def send_message(
self, self,
@ -289,7 +290,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def forward_message( async def forward_message(
self, self,
@ -318,7 +319,7 @@ class Bot(BaseBot):
message_id=message_id, message_id=message_id,
disable_notification=disable_notification, disable_notification=disable_notification,
) )
return await self.emit(call) return await self(call)
async def send_photo( async def send_photo(
self, self,
@ -364,7 +365,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_audio( async def send_audio(
self, self,
@ -431,7 +432,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_document( async def send_document(
self, self,
@ -488,7 +489,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_video( async def send_video(
self, self,
@ -557,7 +558,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_animation( async def send_animation(
self, self,
@ -623,7 +624,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_voice( async def send_voice(
self, self,
@ -675,7 +676,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_video_note( async def send_video_note(
self, self,
@ -729,7 +730,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_media_group( async def send_media_group(
self, self,
@ -759,7 +760,7 @@ class Bot(BaseBot):
disable_notification=disable_notification, disable_notification=disable_notification,
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
) )
return await self.emit(call) return await self(call)
async def send_location( async def send_location(
self, self,
@ -801,7 +802,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def edit_message_live_location( async def edit_message_live_location(
self, self,
@ -841,7 +842,7 @@ class Bot(BaseBot):
inline_message_id=inline_message_id, inline_message_id=inline_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def stop_message_live_location( async def stop_message_live_location(
self, self,
@ -874,7 +875,7 @@ class Bot(BaseBot):
inline_message_id=inline_message_id, inline_message_id=inline_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_venue( async def send_venue(
self, self,
@ -927,7 +928,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_contact( async def send_contact(
self, self,
@ -971,7 +972,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_poll( async def send_poll(
self, self,
@ -1011,7 +1012,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def send_chat_action(self, chat_id: Union[int, str], action: str) -> bool: async def send_chat_action(self, chat_id: Union[int, str], action: str) -> bool:
""" """
@ -1037,7 +1038,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = SendChatAction(chat_id=chat_id, action=action) call = SendChatAction(chat_id=chat_id, action=action)
return await self.emit(call) return await self(call)
async def get_user_profile_photos( async def get_user_profile_photos(
self, user_id: int, offset: Optional[int] = None, limit: Optional[int] = None self, user_id: int, offset: Optional[int] = None, limit: Optional[int] = None
@ -1056,7 +1057,7 @@ class Bot(BaseBot):
:return: Returns a UserProfilePhotos object. :return: Returns a UserProfilePhotos object.
""" """
call = GetUserProfilePhotos(user_id=user_id, offset=offset, limit=limit) call = GetUserProfilePhotos(user_id=user_id, offset=offset, limit=limit)
return await self.emit(call) return await self(call)
async def get_file(self, file_id: str) -> File: async def get_file(self, file_id: str) -> File:
""" """
@ -1075,7 +1076,7 @@ class Bot(BaseBot):
:return: On success, a File object is returned. :return: On success, a File object is returned.
""" """
call = GetFile(file_id=file_id) call = GetFile(file_id=file_id)
return await self.emit(call) return await self(call)
async def kick_chat_member( async def kick_chat_member(
self, self,
@ -1101,7 +1102,7 @@ class Bot(BaseBot):
the group on their own using invite links, etc. Returns True on success. the group on their own using invite links, etc. Returns True on success.
""" """
call = KickChatMember(chat_id=chat_id, user_id=user_id, until_date=until_date) call = KickChatMember(chat_id=chat_id, user_id=user_id, until_date=until_date)
return await self.emit(call) return await self(call)
async def unban_chat_member(self, chat_id: Union[int, str], user_id: int) -> bool: async def unban_chat_member(self, chat_id: Union[int, str], user_id: int) -> bool:
""" """
@ -1118,7 +1119,7 @@ class Bot(BaseBot):
to join via link, etc. Returns True on success. to join via link, etc. Returns True on success.
""" """
call = UnbanChatMember(chat_id=chat_id, user_id=user_id) call = UnbanChatMember(chat_id=chat_id, user_id=user_id)
return await self.emit(call) return await self(call)
async def restrict_chat_member( async def restrict_chat_member(
self, self,
@ -1146,7 +1147,7 @@ class Bot(BaseBot):
call = RestrictChatMember( call = RestrictChatMember(
chat_id=chat_id, user_id=user_id, permissions=permissions, until_date=until_date chat_id=chat_id, user_id=user_id, permissions=permissions, until_date=until_date
) )
return await self.emit(call) return await self(call)
async def promote_chat_member( async def promote_chat_member(
self, self,
@ -1202,7 +1203,28 @@ class Bot(BaseBot):
can_pin_messages=can_pin_messages, can_pin_messages=can_pin_messages,
can_promote_members=can_promote_members, can_promote_members=can_promote_members,
) )
return await self.emit(call) return await self(call)
async def set_chat_administrator_custom_title(
self, chat_id: Union[int, str], user_id: int, custom_title: str
) -> bool:
"""
Use this method to set a custom title for an administrator in a supergroup promoted by the
bot. Returns True on success.
Source: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
:param chat_id: Unique identifier for the target chat or username of the target supergroup
(in the format @supergroupusername)
:param user_id: Unique identifier of the target user
:param custom_title: New custom title for the administrator; 0-16 characters, emoji are
not allowed
:return: Returns True on success.
"""
call = SetChatAdministratorCustomTitle(
chat_id=chat_id, user_id=user_id, custom_title=custom_title
)
return await self(call)
async def set_chat_permissions( async def set_chat_permissions(
self, chat_id: Union[int, str], permissions: ChatPermissions self, chat_id: Union[int, str], permissions: ChatPermissions
@ -1220,7 +1242,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = SetChatPermissions(chat_id=chat_id, permissions=permissions) call = SetChatPermissions(chat_id=chat_id, permissions=permissions)
return await self.emit(call) return await self(call)
async def export_chat_invite_link(self, chat_id: Union[int, str]) -> str: async def export_chat_invite_link(self, chat_id: Union[int, str]) -> str:
""" """
@ -1240,7 +1262,7 @@ class Bot(BaseBot):
:return: Returns the new invite link as String on success. :return: Returns the new invite link as String on success.
""" """
call = ExportChatInviteLink(chat_id=chat_id) call = ExportChatInviteLink(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def set_chat_photo(self, chat_id: Union[int, str], photo: InputFile) -> bool: async def set_chat_photo(self, chat_id: Union[int, str], photo: InputFile) -> bool:
""" """
@ -1256,7 +1278,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = SetChatPhoto(chat_id=chat_id, photo=photo) call = SetChatPhoto(chat_id=chat_id, photo=photo)
return await self.emit(call) return await self(call)
async def delete_chat_photo(self, chat_id: Union[int, str]) -> bool: async def delete_chat_photo(self, chat_id: Union[int, str]) -> bool:
""" """
@ -1271,7 +1293,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = DeleteChatPhoto(chat_id=chat_id) call = DeleteChatPhoto(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def set_chat_title(self, chat_id: Union[int, str], title: str) -> bool: async def set_chat_title(self, chat_id: Union[int, str], title: str) -> bool:
""" """
@ -1287,7 +1309,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = SetChatTitle(chat_id=chat_id, title=title) call = SetChatTitle(chat_id=chat_id, title=title)
return await self.emit(call) return await self(call)
async def set_chat_description( async def set_chat_description(
self, chat_id: Union[int, str], description: Optional[str] = None self, chat_id: Union[int, str], description: Optional[str] = None
@ -1305,7 +1327,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = SetChatDescription(chat_id=chat_id, description=description) call = SetChatDescription(chat_id=chat_id, description=description)
return await self.emit(call) return await self(call)
async def pin_chat_message( async def pin_chat_message(
self, self,
@ -1332,7 +1354,7 @@ class Bot(BaseBot):
call = PinChatMessage( call = PinChatMessage(
chat_id=chat_id, message_id=message_id, disable_notification=disable_notification chat_id=chat_id, message_id=message_id, disable_notification=disable_notification
) )
return await self.emit(call) return await self(call)
async def unpin_chat_message(self, chat_id: Union[int, str]) -> bool: async def unpin_chat_message(self, chat_id: Union[int, str]) -> bool:
""" """
@ -1348,7 +1370,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = UnpinChatMessage(chat_id=chat_id) call = UnpinChatMessage(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def leave_chat(self, chat_id: Union[int, str]) -> bool: async def leave_chat(self, chat_id: Union[int, str]) -> bool:
""" """
@ -1362,7 +1384,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = LeaveChat(chat_id=chat_id) call = LeaveChat(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def get_chat(self, chat_id: Union[int, str]) -> Chat: async def get_chat(self, chat_id: Union[int, str]) -> Chat:
""" """
@ -1377,7 +1399,7 @@ class Bot(BaseBot):
:return: Returns a Chat object on success. :return: Returns a Chat object on success.
""" """
call = GetChat(chat_id=chat_id) call = GetChat(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def get_chat_administrators(self, chat_id: Union[int, str]) -> List[ChatMember]: async def get_chat_administrators(self, chat_id: Union[int, str]) -> List[ChatMember]:
""" """
@ -1396,7 +1418,7 @@ class Bot(BaseBot):
returned. returned.
""" """
call = GetChatAdministrators(chat_id=chat_id) call = GetChatAdministrators(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def get_chat_members_count(self, chat_id: Union[int, str]) -> int: async def get_chat_members_count(self, chat_id: Union[int, str]) -> int:
""" """
@ -1409,7 +1431,7 @@ class Bot(BaseBot):
:return: Returns Int on success. :return: Returns Int on success.
""" """
call = GetChatMembersCount(chat_id=chat_id) call = GetChatMembersCount(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def get_chat_member(self, chat_id: Union[int, str], user_id: int) -> ChatMember: async def get_chat_member(self, chat_id: Union[int, str], user_id: int) -> ChatMember:
""" """
@ -1424,7 +1446,7 @@ class Bot(BaseBot):
:return: Returns a ChatMember object on success. :return: Returns a ChatMember object on success.
""" """
call = GetChatMember(chat_id=chat_id, user_id=user_id) call = GetChatMember(chat_id=chat_id, user_id=user_id)
return await self.emit(call) return await self(call)
async def set_chat_sticker_set(self, chat_id: Union[int, str], sticker_set_name: str) -> bool: async def set_chat_sticker_set(self, chat_id: Union[int, str], sticker_set_name: str) -> bool:
""" """
@ -1442,7 +1464,7 @@ class Bot(BaseBot):
check if the bot can use this method. Returns True on success. check if the bot can use this method. Returns True on success.
""" """
call = SetChatStickerSet(chat_id=chat_id, sticker_set_name=sticker_set_name) call = SetChatStickerSet(chat_id=chat_id, sticker_set_name=sticker_set_name)
return await self.emit(call) return await self(call)
async def delete_chat_sticker_set(self, chat_id: Union[int, str]) -> bool: async def delete_chat_sticker_set(self, chat_id: Union[int, str]) -> bool:
""" """
@ -1459,7 +1481,7 @@ class Bot(BaseBot):
check if the bot can use this method. Returns True on success. check if the bot can use this method. Returns True on success.
""" """
call = DeleteChatStickerSet(chat_id=chat_id) call = DeleteChatStickerSet(chat_id=chat_id)
return await self.emit(call) return await self(call)
async def answer_callback_query( async def answer_callback_query(
self, self,
@ -1500,7 +1522,7 @@ class Bot(BaseBot):
url=url, url=url,
cache_time=cache_time, cache_time=cache_time,
) )
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Updating messages # Group: Updating messages
@ -1547,7 +1569,7 @@ class Bot(BaseBot):
disable_web_page_preview=disable_web_page_preview, disable_web_page_preview=disable_web_page_preview,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def edit_message_caption( async def edit_message_caption(
self, self,
@ -1586,7 +1608,7 @@ class Bot(BaseBot):
parse_mode=parse_mode, parse_mode=parse_mode,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def edit_message_media( async def edit_message_media(
self, self,
@ -1625,7 +1647,7 @@ class Bot(BaseBot):
inline_message_id=inline_message_id, inline_message_id=inline_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def edit_message_reply_markup( async def edit_message_reply_markup(
self, self,
@ -1657,7 +1679,7 @@ class Bot(BaseBot):
inline_message_id=inline_message_id, inline_message_id=inline_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def stop_poll( async def stop_poll(
self, self,
@ -1678,7 +1700,7 @@ class Bot(BaseBot):
:return: On success, the stopped Poll with the final results is returned. :return: On success, the stopped Poll with the final results is returned.
""" """
call = StopPoll(chat_id=chat_id, message_id=message_id, reply_markup=reply_markup) call = StopPoll(chat_id=chat_id, message_id=message_id, reply_markup=reply_markup)
return await self.emit(call) return await self(call)
async def delete_message(self, chat_id: Union[int, str], message_id: int) -> bool: async def delete_message(self, chat_id: Union[int, str], message_id: int) -> bool:
""" """
@ -1701,7 +1723,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = DeleteMessage(chat_id=chat_id, message_id=message_id) call = DeleteMessage(chat_id=chat_id, message_id=message_id)
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Stickers # Group: Stickers
@ -1745,7 +1767,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def get_sticker_set(self, name: str) -> StickerSet: async def get_sticker_set(self, name: str) -> StickerSet:
""" """
@ -1757,7 +1779,7 @@ class Bot(BaseBot):
:return: On success, a StickerSet object is returned. :return: On success, a StickerSet object is returned.
""" """
call = GetStickerSet(name=name) call = GetStickerSet(name=name)
return await self.emit(call) return await self(call)
async def upload_sticker_file(self, user_id: int, png_sticker: InputFile) -> File: async def upload_sticker_file(self, user_id: int, png_sticker: InputFile) -> File:
""" """
@ -1774,7 +1796,7 @@ class Bot(BaseBot):
:return: Returns the uploaded File on success. :return: Returns the uploaded File on success.
""" """
call = UploadStickerFile(user_id=user_id, png_sticker=png_sticker) call = UploadStickerFile(user_id=user_id, png_sticker=png_sticker)
return await self.emit(call) return await self(call)
async def create_new_sticker_set( async def create_new_sticker_set(
self, self,
@ -1819,7 +1841,7 @@ class Bot(BaseBot):
contains_masks=contains_masks, contains_masks=contains_masks,
mask_position=mask_position, mask_position=mask_position,
) )
return await self.emit(call) return await self(call)
async def add_sticker_to_set( async def add_sticker_to_set(
self, self,
@ -1854,7 +1876,7 @@ class Bot(BaseBot):
emojis=emojis, emojis=emojis,
mask_position=mask_position, mask_position=mask_position,
) )
return await self.emit(call) return await self(call)
async def set_sticker_position_in_set(self, sticker: str, position: int) -> bool: async def set_sticker_position_in_set(self, sticker: str, position: int) -> bool:
""" """
@ -1868,7 +1890,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = SetStickerPositionInSet(sticker=sticker, position=position) call = SetStickerPositionInSet(sticker=sticker, position=position)
return await self.emit(call) return await self(call)
async def delete_sticker_from_set(self, sticker: str) -> bool: async def delete_sticker_from_set(self, sticker: str) -> bool:
""" """
@ -1881,7 +1903,7 @@ class Bot(BaseBot):
:return: Returns True on success. :return: Returns True on success.
""" """
call = DeleteStickerFromSet(sticker=sticker) call = DeleteStickerFromSet(sticker=sticker)
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Inline mode # Group: Inline mode
@ -1932,7 +1954,7 @@ class Bot(BaseBot):
switch_pm_text=switch_pm_text, switch_pm_text=switch_pm_text,
switch_pm_parameter=switch_pm_parameter, switch_pm_parameter=switch_pm_parameter,
) )
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Payments # Group: Payments
@ -2035,7 +2057,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def answer_shipping_query( async def answer_shipping_query(
self, self,
@ -2069,7 +2091,7 @@ class Bot(BaseBot):
shipping_options=shipping_options, shipping_options=shipping_options,
error_message=error_message, error_message=error_message,
) )
return await self.emit(call) return await self(call)
async def answer_pre_checkout_query( async def answer_pre_checkout_query(
self, pre_checkout_query_id: str, ok: bool, error_message: Optional[str] = None self, pre_checkout_query_id: str, ok: bool, error_message: Optional[str] = None
@ -2096,7 +2118,7 @@ class Bot(BaseBot):
call = AnswerPreCheckoutQuery( call = AnswerPreCheckoutQuery(
pre_checkout_query_id=pre_checkout_query_id, ok=ok, error_message=error_message pre_checkout_query_id=pre_checkout_query_id, ok=ok, error_message=error_message
) )
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Telegram Passport # Group: Telegram Passport
@ -2125,7 +2147,7 @@ class Bot(BaseBot):
Returns True on success. Returns True on success.
""" """
call = SetPassportDataErrors(user_id=user_id, errors=errors) call = SetPassportDataErrors(user_id=user_id, errors=errors)
return await self.emit(call) return await self(call)
# ============================================================================================= # =============================================================================================
# Group: Games # Group: Games
@ -2163,7 +2185,7 @@ class Bot(BaseBot):
reply_to_message_id=reply_to_message_id, reply_to_message_id=reply_to_message_id,
reply_markup=reply_markup, reply_markup=reply_markup,
) )
return await self.emit(call) return await self(call)
async def set_game_score( async def set_game_score(
self, self,
@ -2208,7 +2230,7 @@ class Bot(BaseBot):
message_id=message_id, message_id=message_id,
inline_message_id=inline_message_id, inline_message_id=inline_message_id,
) )
return await self.emit(call) return await self(call)
async def get_game_high_scores( async def get_game_high_scores(
self, self,
@ -2246,4 +2268,4 @@ class Bot(BaseBot):
message_id=message_id, message_id=message_id,
inline_message_id=inline_message_id, inline_message_id=inline_message_id,
) )
return await self.emit(call) return await self(call)

View file

@ -50,6 +50,7 @@ from .send_venue import SendVenue
from .send_video import SendVideo from .send_video import SendVideo
from .send_video_note import SendVideoNote from .send_video_note import SendVideoNote
from .send_voice import SendVoice from .send_voice import SendVoice
from .set_chat_administrator_custom_title import SetChatAdministratorCustomTitle
from .set_chat_description import SetChatDescription from .set_chat_description import SetChatDescription
from .set_chat_permissions import SetChatPermissions from .set_chat_permissions import SetChatPermissions
from .set_chat_photo import SetChatPhoto from .set_chat_photo import SetChatPhoto
@ -97,6 +98,7 @@ __all__ = (
"UnbanChatMember", "UnbanChatMember",
"RestrictChatMember", "RestrictChatMember",
"PromoteChatMember", "PromoteChatMember",
"SetChatAdministratorCustomTitle",
"SetChatPermissions", "SetChatPermissions",
"ExportChatInviteLink", "ExportChatInviteLink",
"SetChatPhoto", "SetChatPhoto",

View file

@ -54,7 +54,7 @@ class TelegramMethod(abc.ABC, BaseModel, Generic[T]):
return Response[self.__returning__](**data) # type: ignore return Response[self.__returning__](**data) # type: ignore
async def emit(self, bot: Bot) -> T: async def emit(self, bot: Bot) -> T:
return await bot.emit(self) return await bot(self)
def __await__(self): def __await__(self):
from aiogram.api.client.bot import Bot from aiogram.api.client.bot import Bot

View file

@ -0,0 +1,27 @@
from typing import Any, Dict, Union
from .base import Request, TelegramMethod
class SetChatAdministratorCustomTitle(TelegramMethod[bool]):
"""
Use this method to set a custom title for an administrator in a supergroup promoted by the
bot. Returns True on success.
Source: https://core.telegram.org/bots/api#setchatadministratorcustomtitle
"""
__returning__ = bool
chat_id: Union[int, str]
"""Unique identifier for the target chat or username of the target supergroup (in the format
@supergroupusername)"""
user_id: int
"""Unique identifier of the target user"""
custom_title: str
"""New custom title for the administrator; 0-16 characters, emoji are not allowed"""
def build_request(self) -> Request:
data: Dict[str, Any] = self.dict()
return Request(method="setChatAdministratorCustomTitle", data=data)

View file

@ -16,7 +16,10 @@ class Animation(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
width: int width: int
"""Video width as defined by sender""" """Video width as defined by sender"""
height: int height: int

View file

@ -16,7 +16,10 @@ class Audio(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
duration: int duration: int
"""Duration of the audio in seconds as defined by sender""" """Duration of the audio in seconds as defined by sender"""
performer: Optional[str] = None performer: Optional[str] = None

View file

@ -5,8 +5,8 @@ from typing import TYPE_CHECKING, Optional
from .base import TelegramObject from .base import TelegramObject
if TYPE_CHECKING: # pragma: no cover if TYPE_CHECKING: # pragma: no cover
from .chat_photo import ChatPhoto
from .message import Message from .message import Message
from .chat_photo import ChatPhoto
from .chat_permissions import ChatPermissions from .chat_permissions import ChatPermissions
@ -44,6 +44,9 @@ class Chat(TelegramObject):
"""Pinned message, for groups, supergroups and channels. Returned only in getChat.""" """Pinned message, for groups, supergroups and channels. Returned only in getChat."""
permissions: Optional[ChatPermissions] = None permissions: Optional[ChatPermissions] = None
"""Default chat member permissions, for groups and supergroups. Returned only in getChat.""" """Default chat member permissions, for groups and supergroups. Returned only in getChat."""
slow_mode_delay: Optional[int] = None
"""For supergroups, the minimum allowed delay between consecutive messages sent by each
unpriviledged user. Returned only in getChat."""
sticker_set_name: Optional[str] = None sticker_set_name: Optional[str] = None
"""For supergroups, name of group sticker set. Returned only in getChat.""" """For supergroups, name of group sticker set. Returned only in getChat."""
can_set_sticker_set: Optional[bool] = None can_set_sticker_set: Optional[bool] = None

View file

@ -21,6 +21,8 @@ class ChatMember(TelegramObject):
status: str status: str
"""The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', """The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted',
'left' or 'kicked'""" 'left' or 'kicked'"""
custom_title: Optional[str] = None
"""Owner and administrators only. Custom title for this user"""
until_date: Optional[Union[int, datetime.datetime, datetime.timedelta]] = None until_date: Optional[Union[int, datetime.datetime, datetime.timedelta]] = None
"""Restricted and kicked only. Date when restrictions will be lifted for this user; unix time""" """Restricted and kicked only. Date when restrictions will be lifted for this user; unix time"""
can_be_edited: Optional[bool] = None can_be_edited: Optional[bool] = None

View file

@ -13,6 +13,12 @@ class ChatPhoto(TelegramObject):
small_file_id: str small_file_id: str
"""File identifier of small (160x160) chat photo. This file_id can be used only for photo """File identifier of small (160x160) chat photo. This file_id can be used only for photo
download and only for as long as the photo is not changed.""" download and only for as long as the photo is not changed."""
small_file_unique_id: str
"""Unique file identifier of small (160x160) chat photo, which is supposed to be the same over
time and for different bots. Can't be used to download or reuse the file."""
big_file_id: str big_file_id: str
"""File identifier of big (640x640) chat photo. This file_id can be used only for photo """File identifier of big (640x640) chat photo. This file_id can be used only for photo
download and only for as long as the photo is not changed.""" download and only for as long as the photo is not changed."""
big_file_unique_id: str
"""Unique file identifier of big (640x640) chat photo, which is supposed to be the same over
time and for different bots. Can't be used to download or reuse the file."""

View file

@ -16,7 +16,10 @@ class Document(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
thumb: Optional[PhotoSize] = None thumb: Optional[PhotoSize] = None
"""Document thumbnail as defined by sender""" """Document thumbnail as defined by sender"""
file_name: Optional[str] = None file_name: Optional[str] = None

View file

@ -17,7 +17,10 @@ class File(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
file_size: Optional[int] = None file_size: Optional[int] = None
"""File size, if known""" """File size, if known"""
file_path: Optional[str] = None file_path: Optional[str] = None

View file

@ -17,10 +17,12 @@ class MessageEntity(TelegramObject):
""" """
type: str type: str
"""Type of the entity. Can be mention (@username), hashtag, cashtag, bot_command, url, email, """Type of the entity. Can be 'mention' (@username), 'hashtag' (#hashtag), 'cashtag' ($USD),
phone_number, bold (bold text), italic (italic text), code (monowidth string), pre 'bot_command' (/start@jobs_bot), 'url' (https://telegram.org), 'email'
(monowidth block), text_link (for clickable text URLs), text_mention (for users without (do-not-reply@telegram.org), 'phone_number' (+1-212-555-0123), 'bold' (bold text), 'italic'
usernames)""" (italic text), 'underline' (underlined text), 'strikethrough' (strikethrough text), 'code'
(monowidth string), 'pre' (monowidth block), 'text_link' (for clickable text URLs),
'text_mention' (for users without usernames)"""
offset: int offset: int
"""Offset in UTF-16 code units to the start of the entity""" """Offset in UTF-16 code units to the start of the entity"""
length: int length: int

View file

@ -12,7 +12,10 @@ class PassportFile(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
file_size: int file_size: int
"""File size""" """File size"""
file_date: int file_date: int

View file

@ -13,7 +13,10 @@ class PhotoSize(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
width: int width: int
"""Photo width""" """Photo width"""
height: int height: int

View file

@ -7,8 +7,8 @@ from pydantic import Field
from .base import TelegramObject from .base import TelegramObject
if TYPE_CHECKING: # pragma: no cover if TYPE_CHECKING: # pragma: no cover
from .user import User
from .shipping_address import ShippingAddress from .shipping_address import ShippingAddress
from .user import User
class ShippingQuery(TelegramObject): class ShippingQuery(TelegramObject):

View file

@ -5,8 +5,8 @@ from typing import TYPE_CHECKING, Optional
from .base import TelegramObject from .base import TelegramObject
if TYPE_CHECKING: # pragma: no cover if TYPE_CHECKING: # pragma: no cover
from .photo_size import PhotoSize
from .mask_position import MaskPosition from .mask_position import MaskPosition
from .photo_size import PhotoSize
class Sticker(TelegramObject): class Sticker(TelegramObject):
@ -17,7 +17,10 @@ class Sticker(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
width: int width: int
"""Sticker width""" """Sticker width"""
height: int height: int

View file

@ -16,7 +16,10 @@ class Video(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
width: int width: int
"""Video width as defined by sender""" """Video width as defined by sender"""
height: int height: int

View file

@ -16,7 +16,10 @@ class VideoNote(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
length: int length: int
"""Video width and height (diameter of the video message) as defined by sender""" """Video width and height (diameter of the video message) as defined by sender"""
duration: int duration: int

View file

@ -13,7 +13,10 @@ class Voice(TelegramObject):
""" """
file_id: str file_id: str
"""Identifier for this file""" """Identifier for this file, which can be used to download or reuse the file"""
file_unique_id: str
"""Unique identifier for this file, which is supposed to be the same over time and for
different bots. Can't be used to download or reuse the file."""
duration: int duration: int
"""Duration of the audio in seconds as defined by sender""" """Duration of the audio in seconds as defined by sender"""
mime_type: Optional[str] = None mime_type: Optional[str] = None

View file

@ -1,4 +1,4 @@
from .text_decorations import html, markdown from .text_decorations import html_decoration, markdown_decoration
LIST_MD_SYMBOLS = "*_`[" LIST_MD_SYMBOLS = "*_`["
@ -41,7 +41,7 @@ def bold(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return markdown.bold.format(value=html.quote(_join(*content, sep=sep))) return markdown_decoration.bold.format(value=html_decoration.quote(_join(*content, sep=sep)))
def hbold(*content, sep=" "): def hbold(*content, sep=" "):
@ -52,7 +52,7 @@ def hbold(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return html.bold.format(value=html.quote(_join(*content, sep=sep))) return html_decoration.bold.format(value=html_decoration.quote(_join(*content, sep=sep)))
def italic(*content, sep=" "): def italic(*content, sep=" "):
@ -63,7 +63,7 @@ def italic(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return markdown.italic.format(value=html.quote(_join(*content, sep=sep))) return markdown_decoration.italic.format(value=html_decoration.quote(_join(*content, sep=sep)))
def hitalic(*content, sep=" "): def hitalic(*content, sep=" "):
@ -74,7 +74,7 @@ def hitalic(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return html.italic.format(value=html.quote(_join(*content, sep=sep))) return html_decoration.italic.format(value=html_decoration.quote(_join(*content, sep=sep)))
def code(*content, sep=" "): def code(*content, sep=" "):
@ -85,7 +85,7 @@ def code(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return markdown.code.format(value=html.quote(_join(*content, sep=sep))) return markdown_decoration.code.format(value=html_decoration.quote(_join(*content, sep=sep)))
def hcode(*content, sep=" "): def hcode(*content, sep=" "):
@ -96,7 +96,7 @@ def hcode(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return html.code.format(value=html.quote(_join(*content, sep=sep))) return html_decoration.code.format(value=html_decoration.quote(_join(*content, sep=sep)))
def pre(*content, sep="\n"): def pre(*content, sep="\n"):
@ -107,7 +107,7 @@ def pre(*content, sep="\n"):
:param sep: :param sep:
:return: :return:
""" """
return markdown.pre.format(value=html.quote(_join(*content, sep=sep))) return markdown_decoration.pre.format(value=html_decoration.quote(_join(*content, sep=sep)))
def hpre(*content, sep="\n"): def hpre(*content, sep="\n"):
@ -118,7 +118,7 @@ def hpre(*content, sep="\n"):
:param sep: :param sep:
:return: :return:
""" """
return html.pre.format(value=html.quote(_join(*content, sep=sep))) return html_decoration.pre.format(value=html_decoration.quote(_join(*content, sep=sep)))
def underline(*content, sep=" "): def underline(*content, sep=" "):
@ -129,7 +129,9 @@ def underline(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return markdown.underline.format(value=markdown.quote(_join(*content, sep=sep))) return markdown_decoration.underline.format(
value=markdown_decoration.quote(_join(*content, sep=sep))
)
def hunderline(*content, sep=" "): def hunderline(*content, sep=" "):
@ -140,7 +142,7 @@ def hunderline(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return html.underline.format(value=html.quote(_join(*content, sep=sep))) return html_decoration.underline.format(value=html_decoration.quote(_join(*content, sep=sep)))
def strikethrough(*content, sep=" "): def strikethrough(*content, sep=" "):
@ -151,7 +153,9 @@ def strikethrough(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return markdown.strikethrough.format(value=markdown.quote(_join(*content, sep=sep))) return markdown_decoration.strikethrough.format(
value=markdown_decoration.quote(_join(*content, sep=sep))
)
def hstrikethrough(*content, sep=" "): def hstrikethrough(*content, sep=" "):
@ -162,7 +166,9 @@ def hstrikethrough(*content, sep=" "):
:param sep: :param sep:
:return: :return:
""" """
return html.strikethrough.format(value=html.quote(_join(*content, sep=sep))) return html_decoration.strikethrough.format(
value=html_decoration.quote(_join(*content, sep=sep))
)
def link(title: str, url: str) -> str: def link(title: str, url: str) -> str:
@ -173,7 +179,7 @@ def link(title: str, url: str) -> str:
:param url: :param url:
:return: :return:
""" """
return markdown.link.format(value=html.quote(title), link=url) return markdown_decoration.link.format(value=html_decoration.quote(title), link=url)
def hlink(title: str, url: str) -> str: def hlink(title: str, url: str) -> str:
@ -184,7 +190,7 @@ def hlink(title: str, url: str) -> str:
:param url: :param url:
:return: :return:
""" """
return html.link.format(value=html.quote(title), link=url) return html_decoration.link.format(value=html_decoration.quote(title), link=url)
def hide_link(url: str) -> str: def hide_link(url: str) -> str:

View file

@ -6,7 +6,13 @@ from typing import AnyStr, Callable, Generator, Iterable, List, Optional
from aiogram.api.types import MessageEntity from aiogram.api.types import MessageEntity
__all__ = ("TextDecoration", "html", "markdown", "add_surrogate", "remove_surrogate") __all__ = (
"TextDecoration",
"html_decoration",
"markdown_decoration",
"add_surrogate",
"remove_surrogate",
)
@dataclass @dataclass
@ -82,7 +88,7 @@ class TextDecoration:
yield self.quote(text[offset:length]) yield self.quote(text[offset:length])
html = TextDecoration( html_decoration = TextDecoration(
link='<a href="{link}">{value}</a>', link='<a href="{link}">{value}</a>',
bold="<b>{value}</b>", bold="<b>{value}</b>",
italic="<i>{value}</i>", italic="<i>{value}</i>",
@ -93,18 +99,18 @@ html = TextDecoration(
quote=html.escape, quote=html.escape,
) )
markdown = TextDecoration( MARKDOWN_QUOTE_PATTERN = re.compile(r"([_*\[\]()~`>#+\-|{}.!])")
markdown_decoration = TextDecoration(
link="[{value}]({link})", link="[{value}]({link})",
bold="*{value}*", bold="*{value}*",
italic="_{value}_", italic="_{value}_\r",
code="`{value}`", code="`{value}`",
pre="```{value}```", pre="```{value}```",
underline="--{value}--", # Is not supported underline="__{value}__",
strikethrough="~~{value}~~", # Is not supported strikethrough="~{value}~",
quote=lambda text: re.sub( quote=lambda text: re.sub(pattern=MARKDOWN_QUOTE_PATTERN, repl=r"\\\1", string=text),
pattern=r"([*_`\[])", repl=r"\\\1", string=text )
), # Is not always helpful
) # Markdown is not recommended for usage. Use HTML instead
def add_surrogate(text: str) -> str: def add_surrogate(text: str) -> str:

View file

@ -41,24 +41,25 @@ Imports:
- `from aiogram.api.methods import AddStickerToSet` - `from aiogram.api.methods import AddStickerToSet`
- `from aiogram.api.methods.add_sticker_to_set import AddStickerToSet` - `from aiogram.api.methods.add_sticker_to_set import AddStickerToSet`
#### As reply into Webhook
```python3
return AddStickerToSet(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(AddStickerToSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await AddStickerToSet(...) result: bool = await AddStickerToSet(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(AddStickerToSet(...))
```
#### As reply into Webhook in handler
```python3
return AddStickerToSet(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#addstickertoset) - [Official documentation](https://core.telegram.org/bots/api#addstickertoset)
- [aiogram.types.InputFile](../types/input_file.md) - [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.MaskPosition](../types/mask_position.md) - [aiogram.types.MaskPosition](../types/mask_position.md)
- [How to upload file?](../sending_files.md)

View file

@ -43,21 +43,21 @@ Imports:
- `from aiogram.api.methods import AnswerCallbackQuery` - `from aiogram.api.methods import AnswerCallbackQuery`
- `from aiogram.api.methods.answer_callback_query import AnswerCallbackQuery` - `from aiogram.api.methods.answer_callback_query import AnswerCallbackQuery`
#### As reply into Webhook
```python3
return AnswerCallbackQuery(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(AnswerCallbackQuery(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await AnswerCallbackQuery(...) result: bool = await AnswerCallbackQuery(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(AnswerCallbackQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerCallbackQuery(...)
```
## Related pages: ## Related pages:

View file

@ -45,21 +45,21 @@ Imports:
- `from aiogram.api.methods import AnswerInlineQuery` - `from aiogram.api.methods import AnswerInlineQuery`
- `from aiogram.api.methods.answer_inline_query import AnswerInlineQuery` - `from aiogram.api.methods.answer_inline_query import AnswerInlineQuery`
#### As reply into Webhook
```python3
return AnswerInlineQuery(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(AnswerInlineQuery(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await AnswerInlineQuery(...) result: bool = await AnswerInlineQuery(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(AnswerInlineQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerInlineQuery(...)
```
## Related pages: ## Related pages:

View file

@ -39,21 +39,21 @@ Imports:
- `from aiogram.api.methods import AnswerPreCheckoutQuery` - `from aiogram.api.methods import AnswerPreCheckoutQuery`
- `from aiogram.api.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery` - `from aiogram.api.methods.answer_pre_checkout_query import AnswerPreCheckoutQuery`
#### As reply into Webhook
```python3
return AnswerPreCheckoutQuery(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(AnswerPreCheckoutQuery(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await AnswerPreCheckoutQuery(...) result: bool = await AnswerPreCheckoutQuery(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(AnswerPreCheckoutQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerPreCheckoutQuery(...)
```
## Related pages: ## Related pages:

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import AnswerShippingQuery` - `from aiogram.api.methods import AnswerShippingQuery`
- `from aiogram.api.methods.answer_shipping_query import AnswerShippingQuery` - `from aiogram.api.methods.answer_shipping_query import AnswerShippingQuery`
#### As reply into Webhook
```python3
return AnswerShippingQuery(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(AnswerShippingQuery(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await AnswerShippingQuery(...) result: bool = await AnswerShippingQuery(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(AnswerShippingQuery(...))
```
#### As reply into Webhook in handler
```python3
return AnswerShippingQuery(...)
```
## Related pages: ## Related pages:

View file

@ -43,24 +43,25 @@ Imports:
- `from aiogram.api.methods import CreateNewStickerSet` - `from aiogram.api.methods import CreateNewStickerSet`
- `from aiogram.api.methods.create_new_sticker_set import CreateNewStickerSet` - `from aiogram.api.methods.create_new_sticker_set import CreateNewStickerSet`
#### As reply into Webhook
```python3
return CreateNewStickerSet(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(CreateNewStickerSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await CreateNewStickerSet(...) result: bool = await CreateNewStickerSet(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(CreateNewStickerSet(...))
```
#### As reply into Webhook in handler
```python3
return CreateNewStickerSet(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#createnewstickerset) - [Official documentation](https://core.telegram.org/bots/api#createnewstickerset)
- [aiogram.types.InputFile](../types/input_file.md) - [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.MaskPosition](../types/mask_position.md) - [aiogram.types.MaskPosition](../types/mask_position.md)
- [How to upload file?](../sending_files.md)

View file

@ -37,21 +37,21 @@ Imports:
- `from aiogram.api.methods import DeleteChatPhoto` - `from aiogram.api.methods import DeleteChatPhoto`
- `from aiogram.api.methods.delete_chat_photo import DeleteChatPhoto` - `from aiogram.api.methods.delete_chat_photo import DeleteChatPhoto`
#### As reply into Webhook
```python3
return DeleteChatPhoto(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(DeleteChatPhoto(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await DeleteChatPhoto(...) result: bool = await DeleteChatPhoto(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(DeleteChatPhoto(...))
```
#### As reply into Webhook in handler
```python3
return DeleteChatPhoto(...)
```
## Related pages: ## Related pages:

View file

@ -37,21 +37,21 @@ Imports:
- `from aiogram.api.methods import DeleteChatStickerSet` - `from aiogram.api.methods import DeleteChatStickerSet`
- `from aiogram.api.methods.delete_chat_sticker_set import DeleteChatStickerSet` - `from aiogram.api.methods.delete_chat_sticker_set import DeleteChatStickerSet`
#### As reply into Webhook
```python3
return DeleteChatStickerSet(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(DeleteChatStickerSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await DeleteChatStickerSet(...) result: bool = await DeleteChatStickerSet(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(DeleteChatStickerSet(...))
```
#### As reply into Webhook in handler
```python3
return DeleteChatStickerSet(...)
```
## Related pages: ## Related pages:

View file

@ -52,21 +52,21 @@ Imports:
- `from aiogram.api.methods import DeleteMessage` - `from aiogram.api.methods import DeleteMessage`
- `from aiogram.api.methods.delete_message import DeleteMessage` - `from aiogram.api.methods.delete_message import DeleteMessage`
#### As reply into Webhook
```python3
return DeleteMessage(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(DeleteMessage(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await DeleteMessage(...) result: bool = await DeleteMessage(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(DeleteMessage(...))
```
#### As reply into Webhook in handler
```python3
return DeleteMessage(...)
```
## Related pages: ## Related pages:

View file

@ -37,21 +37,21 @@ Imports:
- `from aiogram.api.methods import DeleteStickerFromSet` - `from aiogram.api.methods import DeleteStickerFromSet`
- `from aiogram.api.methods.delete_sticker_from_set import DeleteStickerFromSet` - `from aiogram.api.methods.delete_sticker_from_set import DeleteStickerFromSet`
#### As reply into Webhook
```python3
return DeleteStickerFromSet(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(DeleteStickerFromSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await DeleteStickerFromSet(...) result: bool = await DeleteStickerFromSet(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(DeleteStickerFromSet(...))
```
#### As reply into Webhook in handler
```python3
return DeleteStickerFromSet(...)
```
## Related pages: ## Related pages:

View file

@ -33,18 +33,18 @@ Imports:
#### As reply into Webhook #### As reply into Webhook
```python3 ```python3
return DeleteWebhook(...) result: bool = await DeleteWebhook(...)
``` ```
#### With specific bot #### With specific bot
```python3 ```python3
result: bool = await bot.emit(DeleteWebhook(...)) result: bool = await bot(DeleteWebhook(...))
```
#### As reply into Webhook in handler
```python3
return DeleteWebhook(...)
``` ```
#### In handlers with current bot
```python3
result: bool = await DeleteWebhook(...)
```
## Related pages: ## Related pages:

View file

@ -42,21 +42,21 @@ Imports:
- `from aiogram.api.methods import EditMessageCaption` - `from aiogram.api.methods import EditMessageCaption`
- `from aiogram.api.methods.edit_message_caption import EditMessageCaption` - `from aiogram.api.methods.edit_message_caption import EditMessageCaption`
#### As reply into Webhook
```python3
return EditMessageCaption(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(EditMessageCaption(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await EditMessageCaption(...) result: Union[Message, bool] = await EditMessageCaption(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageCaption(...))
```
#### As reply into Webhook in handler
```python3
return EditMessageCaption(...)
```
## Related pages: ## Related pages:

View file

@ -42,21 +42,21 @@ Imports:
- `from aiogram.api.methods import EditMessageLiveLocation` - `from aiogram.api.methods import EditMessageLiveLocation`
- `from aiogram.api.methods.edit_message_live_location import EditMessageLiveLocation` - `from aiogram.api.methods.edit_message_live_location import EditMessageLiveLocation`
#### As reply into Webhook
```python3
return EditMessageLiveLocation(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(EditMessageLiveLocation(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await EditMessageLiveLocation(...) result: Union[Message, bool] = await EditMessageLiveLocation(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageLiveLocation(...))
```
#### As reply into Webhook in handler
```python3
return EditMessageLiveLocation(...)
```
## Related pages: ## Related pages:

View file

@ -41,21 +41,21 @@ Imports:
- `from aiogram.api.methods import EditMessageMedia` - `from aiogram.api.methods import EditMessageMedia`
- `from aiogram.api.methods.edit_message_media import EditMessageMedia` - `from aiogram.api.methods.edit_message_media import EditMessageMedia`
#### As reply into Webhook
```python3
return EditMessageMedia(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(EditMessageMedia(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await EditMessageMedia(...) result: Union[Message, bool] = await EditMessageMedia(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageMedia(...))
```
#### As reply into Webhook in handler
```python3
return EditMessageMedia(...)
```
## Related pages: ## Related pages:

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import EditMessageReplyMarkup` - `from aiogram.api.methods import EditMessageReplyMarkup`
- `from aiogram.api.methods.edit_message_reply_markup import EditMessageReplyMarkup` - `from aiogram.api.methods.edit_message_reply_markup import EditMessageReplyMarkup`
#### As reply into Webhook
```python3
return EditMessageReplyMarkup(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(EditMessageReplyMarkup(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await EditMessageReplyMarkup(...) result: Union[Message, bool] = await EditMessageReplyMarkup(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageReplyMarkup(...))
```
#### As reply into Webhook in handler
```python3
return EditMessageReplyMarkup(...)
```
## Related pages: ## Related pages:

View file

@ -43,21 +43,21 @@ Imports:
- `from aiogram.api.methods import EditMessageText` - `from aiogram.api.methods import EditMessageText`
- `from aiogram.api.methods.edit_message_text import EditMessageText` - `from aiogram.api.methods.edit_message_text import EditMessageText`
#### As reply into Webhook
```python3
return EditMessageText(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(EditMessageText(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await EditMessageText(...) result: Union[Message, bool] = await EditMessageText(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(EditMessageText(...))
```
#### As reply into Webhook in handler
```python3
return EditMessageText(...)
```
## Related pages: ## Related pages:

View file

@ -39,21 +39,21 @@ Imports:
- `from aiogram.api.methods import ExportChatInviteLink` - `from aiogram.api.methods import ExportChatInviteLink`
- `from aiogram.api.methods.export_chat_invite_link import ExportChatInviteLink` - `from aiogram.api.methods.export_chat_invite_link import ExportChatInviteLink`
#### As reply into Webhook
```python3
return ExportChatInviteLink(...)
```
#### With specific bot
```python3
result: str = await bot.emit(ExportChatInviteLink(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: str = await ExportChatInviteLink(...) result: str = await ExportChatInviteLink(...)
``` ```
#### With specific bot
```python3
result: str = await bot(ExportChatInviteLink(...))
```
#### As reply into Webhook in handler
```python3
return ExportChatInviteLink(...)
```
## Related pages: ## Related pages:

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import ForwardMessage` - `from aiogram.api.methods import ForwardMessage`
- `from aiogram.api.methods.forward_message import ForwardMessage` - `from aiogram.api.methods.forward_message import ForwardMessage`
#### As reply into Webhook
```python3
return ForwardMessage(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(ForwardMessage(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await ForwardMessage(...) result: Message = await ForwardMessage(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(ForwardMessage(...))
```
#### As reply into Webhook in handler
```python3
return ForwardMessage(...)
```
## Related pages: ## Related pages:

View file

@ -37,17 +37,17 @@ Imports:
- `from aiogram.api.methods import GetChat` - `from aiogram.api.methods import GetChat`
- `from aiogram.api.methods.get_chat import GetChat` - `from aiogram.api.methods.get_chat import GetChat`
#### With specific bot
```python3
result: Chat = await bot.emit(GetChat(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Chat = await GetChat(...) result: Chat = await GetChat(...)
``` ```
#### With specific bot
```python3
result: Chat = await bot(GetChat(...))
```
## Related pages: ## Related pages:

View file

@ -37,17 +37,17 @@ Imports:
- `from aiogram.api.methods import GetChatAdministrators` - `from aiogram.api.methods import GetChatAdministrators`
- `from aiogram.api.methods.get_chat_administrators import GetChatAdministrators` - `from aiogram.api.methods.get_chat_administrators import GetChatAdministrators`
#### With specific bot
```python3
result: List[ChatMember] = await bot.emit(GetChatAdministrators(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: List[ChatMember] = await GetChatAdministrators(...) result: List[ChatMember] = await GetChatAdministrators(...)
``` ```
#### With specific bot
```python3
result: List[ChatMember] = await bot(GetChatAdministrators(...))
```
## Related pages: ## Related pages:

View file

@ -38,17 +38,17 @@ Imports:
- `from aiogram.api.methods import GetChatMember` - `from aiogram.api.methods import GetChatMember`
- `from aiogram.api.methods.get_chat_member import GetChatMember` - `from aiogram.api.methods.get_chat_member import GetChatMember`
#### With specific bot
```python3
result: ChatMember = await bot.emit(GetChatMember(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: ChatMember = await GetChatMember(...) result: ChatMember = await GetChatMember(...)
``` ```
#### With specific bot
```python3
result: ChatMember = await bot(GetChatMember(...))
```
## Related pages: ## Related pages:

View file

@ -37,17 +37,17 @@ Imports:
- `from aiogram.api.methods import GetChatMembersCount` - `from aiogram.api.methods import GetChatMembersCount`
- `from aiogram.api.methods.get_chat_members_count import GetChatMembersCount` - `from aiogram.api.methods.get_chat_members_count import GetChatMembersCount`
#### With specific bot
```python3
result: int = await bot.emit(GetChatMembersCount(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: int = await GetChatMembersCount(...) result: int = await GetChatMembersCount(...)
``` ```
#### With specific bot
```python3
result: int = await bot(GetChatMembersCount(...))
```
## Related pages: ## Related pages:

View file

@ -39,17 +39,17 @@ Imports:
- `from aiogram.api.methods import GetFile` - `from aiogram.api.methods import GetFile`
- `from aiogram.api.methods.get_file import GetFile` - `from aiogram.api.methods.get_file import GetFile`
#### With specific bot
```python3
result: File = await bot.emit(GetFile(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: File = await GetFile(...) result: File = await GetFile(...)
``` ```
#### With specific bot
```python3
result: File = await bot(GetFile(...))
```
## Related pages: ## Related pages:

View file

@ -42,17 +42,17 @@ Imports:
- `from aiogram.api.methods import GetGameHighScores` - `from aiogram.api.methods import GetGameHighScores`
- `from aiogram.api.methods.get_game_high_scores import GetGameHighScores` - `from aiogram.api.methods.get_game_high_scores import GetGameHighScores`
#### With specific bot
```python3
result: List[GameHighScore] = await bot.emit(GetGameHighScores(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: List[GameHighScore] = await GetGameHighScores(...) result: List[GameHighScore] = await GetGameHighScores(...)
``` ```
#### With specific bot
```python3
result: List[GameHighScore] = await bot(GetGameHighScores(...))
```
## Related pages: ## Related pages:

View file

@ -31,17 +31,17 @@ Imports:
- `from aiogram.api.methods import GetMe` - `from aiogram.api.methods import GetMe`
- `from aiogram.api.methods.get_me import GetMe` - `from aiogram.api.methods.get_me import GetMe`
#### With specific bot
```python3
result: User = await bot.emit(GetMe(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: User = await GetMe(...) result: User = await GetMe(...)
``` ```
#### With specific bot
```python3
result: User = await bot(GetMe(...))
```
## Related pages: ## Related pages:

View file

@ -37,17 +37,17 @@ Imports:
- `from aiogram.api.methods import GetStickerSet` - `from aiogram.api.methods import GetStickerSet`
- `from aiogram.api.methods.get_sticker_set import GetStickerSet` - `from aiogram.api.methods.get_sticker_set import GetStickerSet`
#### With specific bot
```python3
result: StickerSet = await bot.emit(GetStickerSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: StickerSet = await GetStickerSet(...) result: StickerSet = await GetStickerSet(...)
``` ```
#### With specific bot
```python3
result: StickerSet = await bot(GetStickerSet(...))
```
## Related pages: ## Related pages:

View file

@ -46,17 +46,17 @@ Imports:
- `from aiogram.api.methods import GetUpdates` - `from aiogram.api.methods import GetUpdates`
- `from aiogram.api.methods.get_updates import GetUpdates` - `from aiogram.api.methods.get_updates import GetUpdates`
#### With specific bot
```python3
result: List[Update] = await bot.emit(GetUpdates(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: List[Update] = await GetUpdates(...) result: List[Update] = await GetUpdates(...)
``` ```
#### With specific bot
```python3
result: List[Update] = await bot(GetUpdates(...))
```
## Related pages: ## Related pages:

View file

@ -39,17 +39,17 @@ Imports:
- `from aiogram.api.methods import GetUserProfilePhotos` - `from aiogram.api.methods import GetUserProfilePhotos`
- `from aiogram.api.methods.get_user_profile_photos import GetUserProfilePhotos` - `from aiogram.api.methods.get_user_profile_photos import GetUserProfilePhotos`
#### With specific bot
```python3
result: UserProfilePhotos = await bot.emit(GetUserProfilePhotos(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: UserProfilePhotos = await GetUserProfilePhotos(...) result: UserProfilePhotos = await GetUserProfilePhotos(...)
``` ```
#### With specific bot
```python3
result: UserProfilePhotos = await bot(GetUserProfilePhotos(...))
```
## Related pages: ## Related pages:

View file

@ -31,17 +31,17 @@ Imports:
- `from aiogram.api.methods import GetWebhookInfo` - `from aiogram.api.methods import GetWebhookInfo`
- `from aiogram.api.methods.get_webhook_info import GetWebhookInfo` - `from aiogram.api.methods.get_webhook_info import GetWebhookInfo`
#### With specific bot
```python3
result: WebhookInfo = await bot.emit(GetWebhookInfo(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: WebhookInfo = await GetWebhookInfo(...) result: WebhookInfo = await GetWebhookInfo(...)
``` ```
#### With specific bot
```python3
result: WebhookInfo = await bot(GetWebhookInfo(...))
```
## Related pages: ## Related pages:

View file

@ -39,21 +39,21 @@ Imports:
- `from aiogram.api.methods import KickChatMember` - `from aiogram.api.methods import KickChatMember`
- `from aiogram.api.methods.kick_chat_member import KickChatMember` - `from aiogram.api.methods.kick_chat_member import KickChatMember`
#### As reply into Webhook
```python3
return KickChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(KickChatMember(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await KickChatMember(...) result: bool = await KickChatMember(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(KickChatMember(...))
```
#### As reply into Webhook in handler
```python3
return KickChatMember(...)
```
## Related pages: ## Related pages:

View file

@ -37,21 +37,21 @@ Imports:
- `from aiogram.api.methods import LeaveChat` - `from aiogram.api.methods import LeaveChat`
- `from aiogram.api.methods.leave_chat import LeaveChat` - `from aiogram.api.methods.leave_chat import LeaveChat`
#### As reply into Webhook
```python3
return LeaveChat(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(LeaveChat(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await LeaveChat(...) result: bool = await LeaveChat(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(LeaveChat(...))
```
#### As reply into Webhook in handler
```python3
return LeaveChat(...)
```
## Related pages: ## Related pages:

View file

@ -39,21 +39,21 @@ Imports:
- `from aiogram.api.methods import PinChatMessage` - `from aiogram.api.methods import PinChatMessage`
- `from aiogram.api.methods.pin_chat_message import PinChatMessage` - `from aiogram.api.methods.pin_chat_message import PinChatMessage`
#### As reply into Webhook
```python3
return PinChatMessage(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(PinChatMessage(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await PinChatMessage(...) result: bool = await PinChatMessage(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(PinChatMessage(...))
```
#### As reply into Webhook in handler
```python3
return PinChatMessage(...)
```
## Related pages: ## Related pages:

View file

@ -46,21 +46,21 @@ Imports:
- `from aiogram.api.methods import PromoteChatMember` - `from aiogram.api.methods import PromoteChatMember`
- `from aiogram.api.methods.promote_chat_member import PromoteChatMember` - `from aiogram.api.methods.promote_chat_member import PromoteChatMember`
#### As reply into Webhook
```python3
return PromoteChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(PromoteChatMember(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await PromoteChatMember(...) result: bool = await PromoteChatMember(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(PromoteChatMember(...))
```
#### As reply into Webhook in handler
```python3
return PromoteChatMember(...)
```
## Related pages: ## Related pages:

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import RestrictChatMember` - `from aiogram.api.methods import RestrictChatMember`
- `from aiogram.api.methods.restrict_chat_member import RestrictChatMember` - `from aiogram.api.methods.restrict_chat_member import RestrictChatMember`
#### As reply into Webhook
```python3
return RestrictChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(RestrictChatMember(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await RestrictChatMember(...) result: bool = await RestrictChatMember(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(RestrictChatMember(...))
```
#### As reply into Webhook in handler
```python3
return RestrictChatMember(...)
```
## Related pages: ## Related pages:

View file

@ -47,28 +47,29 @@ Imports:
- `from aiogram.api.methods import SendAnimation` - `from aiogram.api.methods import SendAnimation`
- `from aiogram.api.methods.send_animation import SendAnimation` - `from aiogram.api.methods.send_animation import SendAnimation`
#### As reply into Webhook
```python3
return SendAnimation(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendAnimation(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendAnimation(...) result: Message = await SendAnimation(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendAnimation(...))
```
#### As reply into Webhook in handler
```python3
return SendAnimation(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendanimation) - [Official documentation](https://core.telegram.org/bots/api#sendanimation)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -49,28 +49,29 @@ Imports:
- `from aiogram.api.methods import SendAudio` - `from aiogram.api.methods import SendAudio`
- `from aiogram.api.methods.send_audio import SendAudio` - `from aiogram.api.methods.send_audio import SendAudio`
#### As reply into Webhook
```python3
return SendAudio(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendAudio(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendAudio(...) result: Message = await SendAudio(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendAudio(...))
```
#### As reply into Webhook in handler
```python3
return SendAudio(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendaudio) - [Official documentation](https://core.telegram.org/bots/api#sendaudio)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -42,21 +42,21 @@ Imports:
- `from aiogram.api.methods import SendChatAction` - `from aiogram.api.methods import SendChatAction`
- `from aiogram.api.methods.send_chat_action import SendChatAction` - `from aiogram.api.methods.send_chat_action import SendChatAction`
#### As reply into Webhook
```python3
return SendChatAction(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SendChatAction(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SendChatAction(...) result: bool = await SendChatAction(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SendChatAction(...))
```
#### As reply into Webhook in handler
```python3
return SendChatAction(...)
```
## Related pages: ## Related pages:

View file

@ -44,27 +44,27 @@ Imports:
- `from aiogram.api.methods import SendContact` - `from aiogram.api.methods import SendContact`
- `from aiogram.api.methods.send_contact import SendContact` - `from aiogram.api.methods.send_contact import SendContact`
#### As reply into Webhook
```python3
return SendContact(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendContact(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendContact(...) result: Message = await SendContact(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendContact(...))
```
#### As reply into Webhook in handler
```python3
return SendContact(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendcontact) - [Official documentation](https://core.telegram.org/bots/api#sendcontact)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -44,28 +44,29 @@ Imports:
- `from aiogram.api.methods import SendDocument` - `from aiogram.api.methods import SendDocument`
- `from aiogram.api.methods.send_document import SendDocument` - `from aiogram.api.methods.send_document import SendDocument`
#### As reply into Webhook
```python3
return SendDocument(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendDocument(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendDocument(...) result: Message = await SendDocument(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendDocument(...))
```
#### As reply into Webhook in handler
```python3
return SendDocument(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#senddocument) - [Official documentation](https://core.telegram.org/bots/api#senddocument)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -41,21 +41,21 @@ Imports:
- `from aiogram.api.methods import SendGame` - `from aiogram.api.methods import SendGame`
- `from aiogram.api.methods.send_game import SendGame` - `from aiogram.api.methods.send_game import SendGame`
#### As reply into Webhook
```python3
return SendGame(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendGame(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendGame(...) result: Message = await SendGame(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendGame(...))
```
#### As reply into Webhook in handler
```python3
return SendGame(...)
```
## Related pages: ## Related pages:

View file

@ -59,25 +59,25 @@ Imports:
- `from aiogram.api.methods import SendInvoice` - `from aiogram.api.methods import SendInvoice`
- `from aiogram.api.methods.send_invoice import SendInvoice` - `from aiogram.api.methods.send_invoice import SendInvoice`
#### As reply into Webhook
```python3
return SendInvoice(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendInvoice(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendInvoice(...) result: Message = await SendInvoice(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendInvoice(...))
```
#### As reply into Webhook in handler
```python3
return SendInvoice(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendinvoice) - [Official documentation](https://core.telegram.org/bots/api#sendinvoice)
- [aiogram.types.LabeledPrice](../types/labeled_price.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.LabeledPrice](../types/labeled_price.md)
- [aiogram.types.Message](../types/message.md) - [aiogram.types.Message](../types/message.md)

View file

@ -43,27 +43,27 @@ Imports:
- `from aiogram.api.methods import SendLocation` - `from aiogram.api.methods import SendLocation`
- `from aiogram.api.methods.send_location import SendLocation` - `from aiogram.api.methods.send_location import SendLocation`
#### As reply into Webhook
```python3
return SendLocation(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendLocation(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendLocation(...) result: Message = await SendLocation(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendLocation(...))
```
#### As reply into Webhook in handler
```python3
return SendLocation(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendlocation) - [Official documentation](https://core.telegram.org/bots/api#sendlocation)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import SendMediaGroup` - `from aiogram.api.methods import SendMediaGroup`
- `from aiogram.api.methods.send_media_group import SendMediaGroup` - `from aiogram.api.methods.send_media_group import SendMediaGroup`
#### As reply into Webhook
```python3
return SendMediaGroup(...)
```
#### With specific bot
```python3
result: List[Message] = await bot.emit(SendMediaGroup(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: List[Message] = await SendMediaGroup(...) result: List[Message] = await SendMediaGroup(...)
``` ```
#### With specific bot
```python3
result: List[Message] = await bot(SendMediaGroup(...))
```
#### As reply into Webhook in handler
```python3
return SendMediaGroup(...)
```
## Related pages: ## Related pages:

View file

@ -43,27 +43,27 @@ Imports:
- `from aiogram.api.methods import SendMessage` - `from aiogram.api.methods import SendMessage`
- `from aiogram.api.methods.send_message import SendMessage` - `from aiogram.api.methods.send_message import SendMessage`
#### As reply into Webhook
```python3
return SendMessage(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendMessage(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendMessage(...) result: Message = await SendMessage(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendMessage(...))
```
#### As reply into Webhook in handler
```python3
return SendMessage(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendmessage) - [Official documentation](https://core.telegram.org/bots/api#sendmessage)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -43,28 +43,29 @@ Imports:
- `from aiogram.api.methods import SendPhoto` - `from aiogram.api.methods import SendPhoto`
- `from aiogram.api.methods.send_photo import SendPhoto` - `from aiogram.api.methods.send_photo import SendPhoto`
#### As reply into Webhook
```python3
return SendPhoto(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendPhoto(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendPhoto(...) result: Message = await SendPhoto(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendPhoto(...))
```
#### As reply into Webhook in handler
```python3
return SendPhoto(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendphoto) - [Official documentation](https://core.telegram.org/bots/api#sendphoto)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -42,27 +42,27 @@ Imports:
- `from aiogram.api.methods import SendPoll` - `from aiogram.api.methods import SendPoll`
- `from aiogram.api.methods.send_poll import SendPoll` - `from aiogram.api.methods.send_poll import SendPoll`
#### As reply into Webhook
```python3
return SendPoll(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendPoll(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendPoll(...) result: Message = await SendPoll(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendPoll(...))
```
#### As reply into Webhook in handler
```python3
return SendPoll(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendpoll) - [Official documentation](https://core.telegram.org/bots/api#sendpoll)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -41,28 +41,29 @@ Imports:
- `from aiogram.api.methods import SendSticker` - `from aiogram.api.methods import SendSticker`
- `from aiogram.api.methods.send_sticker import SendSticker` - `from aiogram.api.methods.send_sticker import SendSticker`
#### As reply into Webhook
```python3
return SendSticker(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendSticker(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendSticker(...) result: Message = await SendSticker(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendSticker(...))
```
#### As reply into Webhook in handler
```python3
return SendSticker(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendsticker) - [Official documentation](https://core.telegram.org/bots/api#sendsticker)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -46,27 +46,27 @@ Imports:
- `from aiogram.api.methods import SendVenue` - `from aiogram.api.methods import SendVenue`
- `from aiogram.api.methods.send_venue import SendVenue` - `from aiogram.api.methods.send_venue import SendVenue`
#### As reply into Webhook
```python3
return SendVenue(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendVenue(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendVenue(...) result: Message = await SendVenue(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendVenue(...))
```
#### As reply into Webhook in handler
```python3
return SendVenue(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvenue) - [Official documentation](https://core.telegram.org/bots/api#sendvenue)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)

View file

@ -48,28 +48,29 @@ Imports:
- `from aiogram.api.methods import SendVideo` - `from aiogram.api.methods import SendVideo`
- `from aiogram.api.methods.send_video import SendVideo` - `from aiogram.api.methods.send_video import SendVideo`
#### As reply into Webhook
```python3
return SendVideo(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendVideo(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendVideo(...) result: Message = await SendVideo(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendVideo(...))
```
#### As reply into Webhook in handler
```python3
return SendVideo(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvideo) - [Official documentation](https://core.telegram.org/bots/api#sendvideo)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -44,28 +44,29 @@ Imports:
- `from aiogram.api.methods import SendVideoNote` - `from aiogram.api.methods import SendVideoNote`
- `from aiogram.api.methods.send_video_note import SendVideoNote` - `from aiogram.api.methods.send_video_note import SendVideoNote`
#### As reply into Webhook
```python3
return SendVideoNote(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendVideoNote(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendVideoNote(...) result: Message = await SendVideoNote(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendVideoNote(...))
```
#### As reply into Webhook in handler
```python3
return SendVideoNote(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvideonote) - [Official documentation](https://core.telegram.org/bots/api#sendvideonote)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -44,28 +44,29 @@ Imports:
- `from aiogram.api.methods import SendVoice` - `from aiogram.api.methods import SendVoice`
- `from aiogram.api.methods.send_voice import SendVoice` - `from aiogram.api.methods.send_voice import SendVoice`
#### As reply into Webhook
```python3
return SendVoice(...)
```
#### With specific bot
```python3
result: Message = await bot.emit(SendVoice(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Message = await SendVoice(...) result: Message = await SendVoice(...)
``` ```
#### With specific bot
```python3
result: Message = await bot(SendVoice(...))
```
#### As reply into Webhook in handler
```python3
return SendVoice(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#sendvoice) - [Official documentation](https://core.telegram.org/bots/api#sendvoice)
- [aiogram.types.ForceReply](../types/force_reply.md) - [aiogram.types.ForceReply](../types/force_reply.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md) - [aiogram.types.InlineKeyboardMarkup](../types/inline_keyboard_markup.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.Message](../types/message.md)
- [aiogram.types.ReplyKeyboardMarkup](../types/reply_keyboard_markup.md)
- [aiogram.types.ReplyKeyboardRemove](../types/reply_keyboard_remove.md)
- [How to upload file?](../sending_files.md)

View file

@ -0,0 +1,60 @@
# setChatAdministratorCustomTitle
## Description
Use this method to set a custom title for an administrator in a supergroup promoted by the bot. Returns True on success.
## Arguments
| Name | Type | Description |
| - | - | - |
| `chat_id` | `#!python3 Union[int, str]` | Unique identifier for the target chat or username of the target supergroup (in the format @supergroupusername) |
| `user_id` | `#!python3 int` | Unique identifier of the target user |
| `custom_title` | `#!python3 str` | New custom title for the administrator; 0-16 characters, emoji are not allowed |
## Response
Type: `#!python3 bool`
Description: Returns True on success.
## Usage
### As bot method bot
```python3
result: bool = await bot.set_chat_administrator_custom_title(...)
```
### Method as object
Imports:
- `from aiogram.methods import SetChatAdministratorCustomTitle`
- `from aiogram.api.methods import SetChatAdministratorCustomTitle`
- `from aiogram.api.methods.set_chat_administrator_custom_title import SetChatAdministratorCustomTitle`
#### In handlers with current bot
```python3
result: bool = await SetChatAdministratorCustomTitle(...)
```
#### With specific bot
```python3
result: bool = await bot(SetChatAdministratorCustomTitle(...))
```
#### As reply into Webhook in handler
```python3
return SetChatAdministratorCustomTitle(...)
```
## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchatadministratorcustomtitle)

View file

@ -38,21 +38,21 @@ Imports:
- `from aiogram.api.methods import SetChatDescription` - `from aiogram.api.methods import SetChatDescription`
- `from aiogram.api.methods.set_chat_description import SetChatDescription` - `from aiogram.api.methods.set_chat_description import SetChatDescription`
#### As reply into Webhook
```python3
return SetChatDescription(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetChatDescription(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetChatDescription(...) result: bool = await SetChatDescription(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetChatDescription(...))
```
#### As reply into Webhook in handler
```python3
return SetChatDescription(...)
```
## Related pages: ## Related pages:

View file

@ -38,21 +38,21 @@ Imports:
- `from aiogram.api.methods import SetChatPermissions` - `from aiogram.api.methods import SetChatPermissions`
- `from aiogram.api.methods.set_chat_permissions import SetChatPermissions` - `from aiogram.api.methods.set_chat_permissions import SetChatPermissions`
#### As reply into Webhook
```python3
return SetChatPermissions(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetChatPermissions(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetChatPermissions(...) result: bool = await SetChatPermissions(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetChatPermissions(...))
```
#### As reply into Webhook in handler
```python3
return SetChatPermissions(...)
```
## Related pages: ## Related pages:

View file

@ -38,19 +38,20 @@ Imports:
- `from aiogram.api.methods import SetChatPhoto` - `from aiogram.api.methods import SetChatPhoto`
- `from aiogram.api.methods.set_chat_photo import SetChatPhoto` - `from aiogram.api.methods.set_chat_photo import SetChatPhoto`
#### With specific bot
```python3
result: bool = await bot.emit(SetChatPhoto(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetChatPhoto(...) result: bool = await SetChatPhoto(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetChatPhoto(...))
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setchatphoto) - [Official documentation](https://core.telegram.org/bots/api#setchatphoto)
- [aiogram.types.InputFile](../types/input_file.md) - [aiogram.types.InputFile](../types/input_file.md)
- [How to upload file?](../sending_files.md)

View file

@ -38,21 +38,21 @@ Imports:
- `from aiogram.api.methods import SetChatStickerSet` - `from aiogram.api.methods import SetChatStickerSet`
- `from aiogram.api.methods.set_chat_sticker_set import SetChatStickerSet` - `from aiogram.api.methods.set_chat_sticker_set import SetChatStickerSet`
#### As reply into Webhook
```python3
return SetChatStickerSet(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetChatStickerSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetChatStickerSet(...) result: bool = await SetChatStickerSet(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetChatStickerSet(...))
```
#### As reply into Webhook in handler
```python3
return SetChatStickerSet(...)
```
## Related pages: ## Related pages:

View file

@ -38,21 +38,21 @@ Imports:
- `from aiogram.api.methods import SetChatTitle` - `from aiogram.api.methods import SetChatTitle`
- `from aiogram.api.methods.set_chat_title import SetChatTitle` - `from aiogram.api.methods.set_chat_title import SetChatTitle`
#### As reply into Webhook
```python3
return SetChatTitle(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetChatTitle(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetChatTitle(...) result: bool = await SetChatTitle(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetChatTitle(...))
```
#### As reply into Webhook in handler
```python3
return SetChatTitle(...)
```
## Related pages: ## Related pages:

View file

@ -43,21 +43,21 @@ Imports:
- `from aiogram.api.methods import SetGameScore` - `from aiogram.api.methods import SetGameScore`
- `from aiogram.api.methods.set_game_score import SetGameScore` - `from aiogram.api.methods.set_game_score import SetGameScore`
#### As reply into Webhook
```python3
return SetGameScore(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(SetGameScore(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await SetGameScore(...) result: Union[Message, bool] = await SetGameScore(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(SetGameScore(...))
```
#### As reply into Webhook in handler
```python3
return SetGameScore(...)
```
## Related pages: ## Related pages:

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import SetPassportDataErrors` - `from aiogram.api.methods import SetPassportDataErrors`
- `from aiogram.api.methods.set_passport_data_errors import SetPassportDataErrors` - `from aiogram.api.methods.set_passport_data_errors import SetPassportDataErrors`
#### As reply into Webhook
```python3
return SetPassportDataErrors(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetPassportDataErrors(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetPassportDataErrors(...) result: bool = await SetPassportDataErrors(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetPassportDataErrors(...))
```
#### As reply into Webhook in handler
```python3
return SetPassportDataErrors(...)
```
## Related pages: ## Related pages:

View file

@ -38,21 +38,21 @@ Imports:
- `from aiogram.api.methods import SetStickerPositionInSet` - `from aiogram.api.methods import SetStickerPositionInSet`
- `from aiogram.api.methods.set_sticker_position_in_set import SetStickerPositionInSet` - `from aiogram.api.methods.set_sticker_position_in_set import SetStickerPositionInSet`
#### As reply into Webhook
```python3
return SetStickerPositionInSet(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetStickerPositionInSet(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetStickerPositionInSet(...) result: bool = await SetStickerPositionInSet(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetStickerPositionInSet(...))
```
#### As reply into Webhook in handler
```python3
return SetStickerPositionInSet(...)
```
## Related pages: ## Related pages:

View file

@ -52,23 +52,24 @@ Imports:
- `from aiogram.api.methods import SetWebhook` - `from aiogram.api.methods import SetWebhook`
- `from aiogram.api.methods.set_webhook import SetWebhook` - `from aiogram.api.methods.set_webhook import SetWebhook`
#### As reply into Webhook
```python3
return SetWebhook(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(SetWebhook(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await SetWebhook(...) result: bool = await SetWebhook(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(SetWebhook(...))
```
#### As reply into Webhook in handler
```python3
return SetWebhook(...)
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#setwebhook) - [Official documentation](https://core.telegram.org/bots/api#setwebhook)
- [aiogram.types.InputFile](../types/input_file.md) - [aiogram.types.InputFile](../types/input_file.md)
- [How to upload file?](../sending_files.md)

View file

@ -40,21 +40,21 @@ Imports:
- `from aiogram.api.methods import StopMessageLiveLocation` - `from aiogram.api.methods import StopMessageLiveLocation`
- `from aiogram.api.methods.stop_message_live_location import StopMessageLiveLocation` - `from aiogram.api.methods.stop_message_live_location import StopMessageLiveLocation`
#### As reply into Webhook
```python3
return StopMessageLiveLocation(...)
```
#### With specific bot
```python3
result: Union[Message, bool] = await bot.emit(StopMessageLiveLocation(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Union[Message, bool] = await StopMessageLiveLocation(...) result: Union[Message, bool] = await StopMessageLiveLocation(...)
``` ```
#### With specific bot
```python3
result: Union[Message, bool] = await bot(StopMessageLiveLocation(...))
```
#### As reply into Webhook in handler
```python3
return StopMessageLiveLocation(...)
```
## Related pages: ## Related pages:

View file

@ -39,21 +39,21 @@ Imports:
- `from aiogram.api.methods import StopPoll` - `from aiogram.api.methods import StopPoll`
- `from aiogram.api.methods.stop_poll import StopPoll` - `from aiogram.api.methods.stop_poll import StopPoll`
#### As reply into Webhook
```python3
return StopPoll(...)
```
#### With specific bot
```python3
result: Poll = await bot.emit(StopPoll(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: Poll = await StopPoll(...) result: Poll = await StopPoll(...)
``` ```
#### With specific bot
```python3
result: Poll = await bot(StopPoll(...))
```
#### As reply into Webhook in handler
```python3
return StopPoll(...)
```
## Related pages: ## Related pages:

View file

@ -38,21 +38,21 @@ Imports:
- `from aiogram.api.methods import UnbanChatMember` - `from aiogram.api.methods import UnbanChatMember`
- `from aiogram.api.methods.unban_chat_member import UnbanChatMember` - `from aiogram.api.methods.unban_chat_member import UnbanChatMember`
#### As reply into Webhook
```python3
return UnbanChatMember(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(UnbanChatMember(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await UnbanChatMember(...) result: bool = await UnbanChatMember(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(UnbanChatMember(...))
```
#### As reply into Webhook in handler
```python3
return UnbanChatMember(...)
```
## Related pages: ## Related pages:

View file

@ -37,21 +37,21 @@ Imports:
- `from aiogram.api.methods import UnpinChatMessage` - `from aiogram.api.methods import UnpinChatMessage`
- `from aiogram.api.methods.unpin_chat_message import UnpinChatMessage` - `from aiogram.api.methods.unpin_chat_message import UnpinChatMessage`
#### As reply into Webhook
```python3
return UnpinChatMessage(...)
```
#### With specific bot
```python3
result: bool = await bot.emit(UnpinChatMessage(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: bool = await UnpinChatMessage(...) result: bool = await UnpinChatMessage(...)
``` ```
#### With specific bot
```python3
result: bool = await bot(UnpinChatMessage(...))
```
#### As reply into Webhook in handler
```python3
return UnpinChatMessage(...)
```
## Related pages: ## Related pages:

View file

@ -38,20 +38,21 @@ Imports:
- `from aiogram.api.methods import UploadStickerFile` - `from aiogram.api.methods import UploadStickerFile`
- `from aiogram.api.methods.upload_sticker_file import UploadStickerFile` - `from aiogram.api.methods.upload_sticker_file import UploadStickerFile`
#### With specific bot
```python3
result: File = await bot.emit(UploadStickerFile(...))
```
#### In handlers with current bot #### In handlers with current bot
```python3 ```python3
result: File = await UploadStickerFile(...) result: File = await UploadStickerFile(...)
``` ```
#### With specific bot
```python3
result: File = await bot(UploadStickerFile(...))
```
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#uploadstickerfile) - [Official documentation](https://core.telegram.org/bots/api#uploadstickerfile)
- [aiogram.types.InputFile](../types/input_file.md)
- [aiogram.types.File](../types/file.md) - [aiogram.types.File](../types/file.md)
- [aiogram.types.InputFile](../types/input_file.md)
- [How to upload file?](../sending_files.md)

View file

@ -9,7 +9,8 @@ This object represents an animation file (GIF or H.264/MPEG-4 AVC video without
| Name | Type | Description | | Name | Type | Description |
| - | - | - | | - | - | - |
| `file_id` | `#!python str` | Identifier for this file | | `file_id` | `#!python str` | Identifier for this file, which can be used to download or reuse the file |
| `file_unique_id` | `#!python str` | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
| `width` | `#!python int` | Video width as defined by sender | | `width` | `#!python int` | Video width as defined by sender |
| `height` | `#!python int` | Video height as defined by sender | | `height` | `#!python int` | Video height as defined by sender |
| `duration` | `#!python int` | Duration of the video in seconds as defined by sender | | `duration` | `#!python int` | Duration of the video in seconds as defined by sender |

View file

@ -9,7 +9,8 @@ This object represents an audio file to be treated as music by the Telegram clie
| Name | Type | Description | | Name | Type | Description |
| - | - | - | | - | - | - |
| `file_id` | `#!python str` | Identifier for this file | | `file_id` | `#!python str` | Identifier for this file, which can be used to download or reuse the file |
| `file_unique_id` | `#!python str` | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
| `duration` | `#!python int` | Duration of the audio in seconds as defined by sender | | `duration` | `#!python int` | Duration of the audio in seconds as defined by sender |
| `performer` | `#!python Optional[str]` | Optional. Performer of the audio as defined by sender or by audio tags | | `performer` | `#!python Optional[str]` | Optional. Performer of the audio as defined by sender or by audio tags |
| `title` | `#!python Optional[str]` | Optional. Title of the audio as defined by sender or by audio tags | | `title` | `#!python Optional[str]` | Optional. Title of the audio as defined by sender or by audio tags |

View file

@ -30,5 +30,5 @@ NOTE: After the user presses a callback button, Telegram clients will display a
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#callbackquery) - [Official documentation](https://core.telegram.org/bots/api#callbackquery)
- [aiogram.types.User](../types/user.md)
- [aiogram.types.Message](../types/message.md) - [aiogram.types.Message](../types/message.md)
- [aiogram.types.User](../types/user.md)

View file

@ -20,6 +20,7 @@ This object represents a chat.
| `invite_link` | `#!python Optional[str]` | Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat. | | `invite_link` | `#!python Optional[str]` | Optional. Chat invite link, for groups, supergroups and channel chats. Each administrator in a chat generates their own invite links, so the bot must first generate the link using exportChatInviteLink. Returned only in getChat. |
| `pinned_message` | `#!python Optional[Message]` | Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat. | | `pinned_message` | `#!python Optional[Message]` | Optional. Pinned message, for groups, supergroups and channels. Returned only in getChat. |
| `permissions` | `#!python Optional[ChatPermissions]` | Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. | | `permissions` | `#!python Optional[ChatPermissions]` | Optional. Default chat member permissions, for groups and supergroups. Returned only in getChat. |
| `slow_mode_delay` | `#!python Optional[int]` | Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user. Returned only in getChat. |
| `sticker_set_name` | `#!python Optional[str]` | Optional. For supergroups, name of group sticker set. Returned only in getChat. | | `sticker_set_name` | `#!python Optional[str]` | Optional. For supergroups, name of group sticker set. Returned only in getChat. |
| `can_set_sticker_set` | `#!python Optional[bool]` | Optional. True, if the bot can change the group sticker set. Returned only in getChat. | | `can_set_sticker_set` | `#!python Optional[bool]` | Optional. True, if the bot can change the group sticker set. Returned only in getChat. |

View file

@ -11,6 +11,7 @@ This object contains information about one member of a chat.
| - | - | - | | - | - | - |
| `user` | `#!python User` | Information about the user | | `user` | `#!python User` | Information about the user |
| `status` | `#!python str` | The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', 'left' or 'kicked' | | `status` | `#!python str` | The member's status in the chat. Can be 'creator', 'administrator', 'member', 'restricted', 'left' or 'kicked' |
| `custom_title` | `#!python Optional[str]` | Optional. Owner and administrators only. Custom title for this user |
| `until_date` | `#!python Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time | | `until_date` | `#!python Optional[Union[int, datetime.datetime, datetime.timedelta]]` | Optional. Restricted and kicked only. Date when restrictions will be lifted for this user; unix time |
| `can_be_edited` | `#!python Optional[bool]` | Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user | | `can_be_edited` | `#!python Optional[bool]` | Optional. Administrators only. True, if the bot is allowed to edit administrator privileges of that user |
| `can_post_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can post in the channel; channels only | | `can_post_messages` | `#!python Optional[bool]` | Optional. Administrators only. True, if the administrator can post in the channel; channels only |

View file

@ -10,7 +10,9 @@ This object represents a chat photo.
| Name | Type | Description | | Name | Type | Description |
| - | - | - | | - | - | - |
| `small_file_id` | `#!python str` | File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. | | `small_file_id` | `#!python str` | File identifier of small (160x160) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. |
| `small_file_unique_id` | `#!python str` | Unique file identifier of small (160x160) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
| `big_file_id` | `#!python str` | File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. | | `big_file_id` | `#!python str` | File identifier of big (640x640) chat photo. This file_id can be used only for photo download and only for as long as the photo is not changed. |
| `big_file_unique_id` | `#!python str` | Unique file identifier of big (640x640) chat photo, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |

View file

@ -9,7 +9,8 @@ This object represents a general file (as opposed to photos, voice messages and
| Name | Type | Description | | Name | Type | Description |
| - | - | - | | - | - | - |
| `file_id` | `#!python str` | Identifier for this file | | `file_id` | `#!python str` | Identifier for this file, which can be used to download or reuse the file |
| `file_unique_id` | `#!python str` | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
| `thumb` | `#!python Optional[PhotoSize]` | Optional. Document thumbnail as defined by sender | | `thumb` | `#!python Optional[PhotoSize]` | Optional. Document thumbnail as defined by sender |
| `file_name` | `#!python Optional[str]` | Optional. Original filename as defined by sender | | `file_name` | `#!python Optional[str]` | Optional. Original filename as defined by sender |
| `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender | | `mime_type` | `#!python Optional[str]` | Optional. MIME type of the file as defined by sender |

View file

@ -11,7 +11,8 @@ Maximum file size to download is 20 MB
| Name | Type | Description | | Name | Type | Description |
| - | - | - | | - | - | - |
| `file_id` | `#!python str` | Identifier for this file | | `file_id` | `#!python str` | Identifier for this file, which can be used to download or reuse the file |
| `file_unique_id` | `#!python str` | Unique identifier for this file, which is supposed to be the same over time and for different bots. Can't be used to download or reuse the file. |
| `file_size` | `#!python Optional[int]` | Optional. File size, if known | | `file_size` | `#!python Optional[int]` | Optional. File size, if known |
| `file_path` | `#!python Optional[str]` | Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. | | `file_path` | `#!python Optional[str]` | Optional. File path. Use https://api.telegram.org/file/bot<token>/<file_path> to get the file. |

View file

@ -27,6 +27,6 @@ This object represents a game. Use BotFather to create and edit games, their sho
## Related pages: ## Related pages:
- [Official documentation](https://core.telegram.org/bots/api#game) - [Official documentation](https://core.telegram.org/bots/api#game)
- [aiogram.types.MessageEntity](../types/message_entity.md)
- [aiogram.types.Animation](../types/animation.md) - [aiogram.types.Animation](../types/animation.md)
- [aiogram.types.MessageEntity](../types/message_entity.md)
- [aiogram.types.PhotoSize](../types/photo_size.md) - [aiogram.types.PhotoSize](../types/photo_size.md)

Some files were not shown because too many files have changed in this diff Show more