Chat#

class aiogram.types.chat.Chat(*, id: int, type: str, title: Optional[str] = None, username: Optional[str] = None, first_name: Optional[str] = None, last_name: Optional[str] = None, is_forum: Optional[bool] = None, photo: Optional[ChatPhoto] = None, active_usernames: Optional[List[str]] = None, emoji_status_custom_emoji_id: Optional[str] = None, bio: Optional[str] = None, has_private_forwards: Optional[bool] = None, has_restricted_voice_and_video_messages: Optional[bool] = None, join_to_send_messages: Optional[bool] = None, join_by_request: Optional[bool] = None, description: Optional[str] = None, invite_link: Optional[str] = None, pinned_message: Optional[Message] = None, permissions: Optional[ChatPermissions] = None, slow_mode_delay: Optional[int] = None, message_auto_delete_time: Optional[int] = None, has_aggressive_anti_spam_enabled: Optional[bool] = None, has_hidden_members: Optional[bool] = None, has_protected_content: Optional[bool] = None, sticker_set_name: Optional[str] = None, can_set_sticker_set: Optional[bool] = None, linked_chat_id: Optional[int] = None, location: Optional[ChatLocation] = None, **extra_data: Any)[source]#

This object represents a chat.

Source: https://core.telegram.org/bots/api#chat

id: int#

Unique identifier for this chat. This number may have more than 32 significant bits and some programming languages may have difficulty/silent defects in interpreting it. But it has at most 52 significant bits, so a signed 64-bit integer or double-precision float type are safe for storing this identifier.

type: str#

Type of chat, can be either ‘private’, ‘group’, ‘supergroup’ or ‘channel’

title: Optional[str]#

Optional. Title, for supergroups, channels and group chats

username: Optional[str]#

Optional. Username, for private chats, supergroups and channels if available

first_name: Optional[str]#

Optional. First name of the other party in a private chat

last_name: Optional[str]#

Optional. Last name of the other party in a private chat

is_forum: Optional[bool]#

Optional. True, if the supergroup chat is a forum (has topics enabled)

photo: Optional[ChatPhoto]#

Optional. Chat photo. Returned only in aiogram.methods.get_chat.GetChat.

active_usernames: Optional[List[str]]#

Optional. If non-empty, the list of all active chat usernames; for private chats, supergroups and channels. Returned only in aiogram.methods.get_chat.GetChat.

emoji_status_custom_emoji_id: Optional[str]#

Optional. Custom emoji identifier of emoji status of the other party in a private chat. Returned only in aiogram.methods.get_chat.GetChat.

bio: Optional[str]#

Optional. Bio of the other party in a private chat. Returned only in aiogram.methods.get_chat.GetChat.

has_private_forwards: Optional[bool]#

Optional. True, if privacy settings of the other party in the private chat allows to use tg://user?id=<user_id> links only in chats with the user. Returned only in aiogram.methods.get_chat.GetChat.

has_restricted_voice_and_video_messages: Optional[bool]#

Optional. True, if the privacy settings of the other party restrict sending voice and video note messages in the private chat. Returned only in aiogram.methods.get_chat.GetChat.

join_to_send_messages: Optional[bool]#

Optional. True, if users need to join the supergroup before they can send messages. Returned only in aiogram.methods.get_chat.GetChat.

join_by_request: Optional[bool]#

Optional. True, if all users directly joining the supergroup need to be approved by supergroup administrators. Returned only in aiogram.methods.get_chat.GetChat.

description: Optional[str]#

Optional. Description, for groups, supergroups and channel chats. Returned only in aiogram.methods.get_chat.GetChat.

Optional. Primary invite link, for groups, supergroups and channel chats. Returned only in aiogram.methods.get_chat.GetChat.

pinned_message: Optional[Message]#

Optional. The most recent pinned message (by sending date). Returned only in aiogram.methods.get_chat.GetChat.

permissions: Optional[ChatPermissions]#

Optional. Default chat member permissions, for groups and supergroups. Returned only in aiogram.methods.get_chat.GetChat.

slow_mode_delay: Optional[int]#

Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unpriviledged user; in seconds. Returned only in aiogram.methods.get_chat.GetChat.

message_auto_delete_time: Optional[int]#

Optional. The time after which all messages sent to the chat will be automatically deleted; in seconds. Returned only in aiogram.methods.get_chat.GetChat.

has_aggressive_anti_spam_enabled: Optional[bool]#

Optional. True, if aggressive anti-spam checks are enabled in the supergroup. The field is only available to chat administrators. Returned only in aiogram.methods.get_chat.GetChat.

has_hidden_members: Optional[bool]#

Optional. True, if non-administrators can only get the list of bots and administrators in the chat. Returned only in aiogram.methods.get_chat.GetChat.

has_protected_content: Optional[bool]#

Optional. True, if messages from the chat can’t be forwarded to other chats. Returned only in aiogram.methods.get_chat.GetChat.

sticker_set_name: Optional[str]#

Optional. For supergroups, name of group sticker set. Returned only in aiogram.methods.get_chat.GetChat.

can_set_sticker_set: Optional[bool]#

Optional. True, if the bot can change the group sticker set. Returned only in aiogram.methods.get_chat.GetChat.

linked_chat_id: Optional[int]#

Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. This identifier may be greater than 32 bits and some programming languages may have difficulty/silent defects in interpreting it. But it is smaller than 52 bits, so a signed 64 bit integer or double-precision float type are safe for storing this identifier. Returned only in aiogram.methods.get_chat.GetChat.

location: Optional[ChatLocation]#

Optional. For supergroups, the location to which the supergroup is connected. Returned only in aiogram.methods.get_chat.GetChat.

property shifted_id: int#

Returns shifted chat ID (positive and without “-100” prefix). Mostly used for private links like t.me/c/chat_id/message_id

Currently supergroup/channel IDs have 10-digit ID after “-100” prefix removed. However, these IDs might become 11-digit in future. So, first we remove “-100” prefix and count remaining number length. Then we multiple -1 * 10 ^ (number_length + 2) Finally, self.id is substracted from that number

property full_name: str#

Get full name of the Chat.

For private chat it is first_name + last_name. For other chat types it is title.

ban_sender_chat(sender_chat_id: int, **kwargs: Any) BanChatSenderChat[source]#

Shortcut for method aiogram.methods.ban_chat_sender_chat.BanChatSenderChat will automatically fill method attributes:

  • chat_id

Use this method to ban a channel chat in a supergroup or a channel. Until the chat is unbanned, the owner of the banned chat won’t be able to send messages on behalf of any of their channels. The bot must be an administrator in the supergroup or channel for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#banchatsenderchat

Parameters:

sender_chat_id – Unique identifier of the target sender chat

Returns:

instance of method aiogram.methods.ban_chat_sender_chat.BanChatSenderChat

unban_sender_chat(sender_chat_id: int, **kwargs: Any) UnbanChatSenderChat[source]#

Shortcut for method aiogram.methods.unban_chat_sender_chat.UnbanChatSenderChat will automatically fill method attributes:

  • chat_id

Use this method to unban a previously banned channel chat in a supergroup or channel. The bot must be an administrator for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#unbanchatsenderchat

Parameters:

sender_chat_id – Unique identifier of the target sender chat

Returns:

instance of method aiogram.methods.unban_chat_sender_chat.UnbanChatSenderChat

get_administrators(**kwargs: Any) GetChatAdministrators[source]#

Shortcut for method aiogram.methods.get_chat_administrators.GetChatAdministrators will automatically fill method attributes:

  • chat_id

Use this method to get a list of administrators in a chat, which aren’t bots. Returns an Array of aiogram.types.chat_member.ChatMember objects.

Source: https://core.telegram.org/bots/api#getchatadministrators

Returns:

instance of method aiogram.methods.get_chat_administrators.GetChatAdministrators

delete_message(message_id: int, **kwargs: Any) DeleteMessage[source]#

Shortcut for method aiogram.methods.delete_message.DeleteMessage will automatically fill method attributes:

  • chat_id

Use this method to delete a message, including service messages, with the following limitations:

  • A message can only be deleted if it was sent less than 48 hours ago.

  • Service messages about a supergroup, channel, or forum topic creation can’t be deleted.

  • A dice message in a private chat can only be deleted if it was sent more than 24 hours ago.

  • Bots can delete outgoing messages in private chats, groups, and supergroups.

  • Bots can delete incoming messages in private chats.

  • Bots granted can_post_messages permissions can delete outgoing messages in channels.

  • If the bot is an administrator of a group, it can delete any message there.

  • If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.

Returns True on success.

Source: https://core.telegram.org/bots/api#deletemessage

Parameters:

message_id – Identifier of the message to delete

Returns:

instance of method aiogram.methods.delete_message.DeleteMessage

Shortcut for method aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink will automatically fill method attributes:

  • chat_id

Use this method to revoke an invite link created by the bot. If the primary link is revoked, a new link is automatically generated. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the revoked invite link as aiogram.types.chat_invite_link.ChatInviteLink object.

Source: https://core.telegram.org/bots/api#revokechatinvitelink

Parameters:

invite_link – The invite link to revoke

Returns:

instance of method aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink

Shortcut for method aiogram.methods.edit_chat_invite_link.EditChatInviteLink will automatically fill method attributes:

  • chat_id

Use this method to edit a non-primary invite link created by the bot. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the edited invite link as a aiogram.types.chat_invite_link.ChatInviteLink object.

Source: https://core.telegram.org/bots/api#editchatinvitelink

Parameters:
  • invite_link – The invite link to edit

  • name – Invite link name; 0-32 characters

  • expire_date – Point in time (Unix timestamp) when the link will expire

  • member_limit – The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

  • creates_join_requestTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can’t be specified

Returns:

instance of method aiogram.methods.edit_chat_invite_link.EditChatInviteLink

Shortcut for method aiogram.methods.create_chat_invite_link.CreateChatInviteLink will automatically fill method attributes:

  • chat_id

Use this method to create an additional invite link for a chat. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. The link can be revoked using the method aiogram.methods.revoke_chat_invite_link.RevokeChatInviteLink. Returns the new invite link as aiogram.types.chat_invite_link.ChatInviteLink object.

Source: https://core.telegram.org/bots/api#createchatinvitelink

Parameters:
  • name – Invite link name; 0-32 characters

  • expire_date – Point in time (Unix timestamp) when the link will expire

  • member_limit – The maximum number of users that can be members of the chat simultaneously after joining the chat via this invite link; 1-99999

  • creates_join_requestTrue, if users joining the chat via the link need to be approved by chat administrators. If True, member_limit can’t be specified

Returns:

instance of method aiogram.methods.create_chat_invite_link.CreateChatInviteLink

Shortcut for method aiogram.methods.export_chat_invite_link.ExportChatInviteLink will automatically fill method attributes:

  • chat_id

Use this method to generate a new primary invite link for a chat; any previously generated primary link is revoked. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns the new invite link as String on success.

Note: Each administrator in a chat generates their own invite links. Bots can’t use invite links generated by other administrators. If you want your bot to work with invite links, it will need to generate its own link using aiogram.methods.export_chat_invite_link.ExportChatInviteLink or by calling the aiogram.methods.get_chat.GetChat method. If your bot needs to generate a new primary invite link replacing its previous one, use aiogram.methods.export_chat_invite_link.ExportChatInviteLink again.

Source: https://core.telegram.org/bots/api#exportchatinvitelink

Returns:

instance of method aiogram.methods.export_chat_invite_link.ExportChatInviteLink

do(action: str, message_thread_id: Optional[int] = None, **kwargs: Any) SendChatAction[source]#

Shortcut for method aiogram.methods.send_chat_action.SendChatAction will automatically fill method attributes:

  • chat_id

Use this method when you need to tell the user that something is happening on the bot’s side. The status is set for 5 seconds or less (when a message arrives from your bot, Telegram clients clear its typing status). Returns True on success.

Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message along the lines of ‘Retrieving image, please wait…’, the bot may use aiogram.methods.send_chat_action.SendChatAction with action = upload_photo. The user will see a ‘sending photo’ status for the bot.

We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.

Source: https://core.telegram.org/bots/api#sendchataction

Parameters:
  • action – Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text messages, upload_photo for photos, record_video or upload_video for videos, record_voice or upload_voice for voice notes, upload_document for general files, choose_sticker for stickers, find_location for location data, record_video_note or upload_video_note for video notes.

  • message_thread_id – Unique identifier for the target message thread; supergroups only

Returns:

instance of method aiogram.methods.send_chat_action.SendChatAction

delete_sticker_set(**kwargs: Any) DeleteChatStickerSet[source]#

Shortcut for method aiogram.methods.delete_chat_sticker_set.DeleteChatStickerSet will automatically fill method attributes:

  • chat_id

Use this method to delete a group sticker set from a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in aiogram.methods.get_chat.GetChat requests to check if the bot can use this method. Returns True on success.

Source: https://core.telegram.org/bots/api#deletechatstickerset

Returns:

instance of method aiogram.methods.delete_chat_sticker_set.DeleteChatStickerSet

set_sticker_set(sticker_set_name: str, **kwargs: Any) SetChatStickerSet[source]#

Shortcut for method aiogram.methods.set_chat_sticker_set.SetChatStickerSet will automatically fill method attributes:

  • chat_id

Use this method to set a new group sticker set for a supergroup. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Use the field can_set_sticker_set optionally returned in aiogram.methods.get_chat.GetChat requests to check if the bot can use this method. Returns True on success.

Source: https://core.telegram.org/bots/api#setchatstickerset

Parameters:

sticker_set_name – Name of the sticker set to be set as the group sticker set

Returns:

instance of method aiogram.methods.set_chat_sticker_set.SetChatStickerSet

get_member(user_id: int, **kwargs: Any) GetChatMember[source]#

Shortcut for method aiogram.methods.get_chat_member.GetChatMember will automatically fill method attributes:

  • chat_id

Use this method to get information about a member of a chat. The method is guaranteed to work for other users, only if the bot is an administrator in the chat. Returns a aiogram.types.chat_member.ChatMember object on success.

Source: https://core.telegram.org/bots/api#getchatmember

Parameters:

user_id – Unique identifier of the target user

Returns:

instance of method aiogram.methods.get_chat_member.GetChatMember

get_member_count(**kwargs: Any) GetChatMemberCount[source]#

Shortcut for method aiogram.methods.get_chat_member_count.GetChatMemberCount will automatically fill method attributes:

  • chat_id

Use this method to get the number of members in a chat. Returns Int on success.

Source: https://core.telegram.org/bots/api#getchatmembercount

Returns:

instance of method aiogram.methods.get_chat_member_count.GetChatMemberCount

leave(**kwargs: Any) LeaveChat[source]#

Shortcut for method aiogram.methods.leave_chat.LeaveChat will automatically fill method attributes:

  • chat_id

Use this method for your bot to leave a group, supergroup or channel. Returns True on success.

Source: https://core.telegram.org/bots/api#leavechat

Returns:

instance of method aiogram.methods.leave_chat.LeaveChat

unpin_all_messages(**kwargs: Any) UnpinAllChatMessages[source]#

Shortcut for method aiogram.methods.unpin_all_chat_messages.UnpinAllChatMessages will automatically fill method attributes:

  • chat_id

Use this method to clear the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.

Source: https://core.telegram.org/bots/api#unpinallchatmessages

Returns:

instance of method aiogram.methods.unpin_all_chat_messages.UnpinAllChatMessages

unpin_message(message_id: Optional[int] = None, **kwargs: Any) UnpinChatMessage[source]#

Shortcut for method aiogram.methods.unpin_chat_message.UnpinChatMessage will automatically fill method attributes:

  • chat_id

Use this method to remove a message from the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.

Source: https://core.telegram.org/bots/api#unpinchatmessage

Parameters:

message_id – Identifier of a message to unpin. If not specified, the most recent pinned message (by sending date) will be unpinned.

Returns:

instance of method aiogram.methods.unpin_chat_message.UnpinChatMessage

pin_message(message_id: int, disable_notification: Optional[bool] = None, **kwargs: Any) PinChatMessage[source]#

Shortcut for method aiogram.methods.pin_chat_message.PinChatMessage will automatically fill method attributes:

  • chat_id

Use this method to add a message to the list of pinned messages in a chat. If the chat is not a private chat, the bot must be an administrator in the chat for this to work and must have the ‘can_pin_messages’ administrator right in a supergroup or ‘can_edit_messages’ administrator right in a channel. Returns True on success.

Source: https://core.telegram.org/bots/api#pinchatmessage

Parameters:
  • message_id – Identifier of a message to pin

  • disable_notification – Pass True if it is not necessary to send a notification to all chat members about the new pinned message. Notifications are always disabled in channels and private chats.

Returns:

instance of method aiogram.methods.pin_chat_message.PinChatMessage

set_administrator_custom_title(user_id: int, custom_title: str, **kwargs: Any) SetChatAdministratorCustomTitle[source]#

Shortcut for method aiogram.methods.set_chat_administrator_custom_title.SetChatAdministratorCustomTitle will automatically fill method attributes:

  • chat_id

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

Parameters:
  • user_id – Unique identifier of the target user

  • custom_title – New custom title for the administrator; 0-16 characters, emoji are not allowed

Returns:

instance of method aiogram.methods.set_chat_administrator_custom_title.SetChatAdministratorCustomTitle

set_permissions(permissions: ChatPermissions, **kwargs: Any) SetChatPermissions[source]#

Shortcut for method aiogram.methods.set_chat_permissions.SetChatPermissions will automatically fill method attributes:

  • chat_id

Use this method to set default chat permissions for all members. The bot must be an administrator in the group or a supergroup for this to work and must have the can_restrict_members administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#setchatpermissions

Parameters:

permissions – A JSON-serialized object for new default chat permissions

Returns:

instance of method aiogram.methods.set_chat_permissions.SetChatPermissions

promote(user_id: int, is_anonymous: Optional[bool] = None, can_manage_chat: Optional[bool] = None, can_post_messages: Optional[bool] = None, can_edit_messages: Optional[bool] = None, can_delete_messages: Optional[bool] = None, can_manage_video_chats: Optional[bool] = None, can_restrict_members: Optional[bool] = None, can_promote_members: Optional[bool] = None, can_change_info: Optional[bool] = None, can_invite_users: Optional[bool] = None, can_pin_messages: Optional[bool] = None, can_manage_topics: Optional[bool] = None, **kwargs: Any) PromoteChatMember[source]#

Shortcut for method aiogram.methods.promote_chat_member.PromoteChatMember will automatically fill method attributes:

  • chat_id

Use this method to promote or demote a user in a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Pass False for all boolean parameters to demote a user. Returns True on success.

Source: https://core.telegram.org/bots/api#promotechatmember

Parameters:
  • user_id – Unique identifier of the target user

  • is_anonymous – Pass True if the administrator’s presence in the chat is hidden

  • can_manage_chat – Pass True if the administrator can access the chat event log, chat statistics, message statistics in channels, see channel members, see anonymous administrators in supergroups and ignore slow mode. Implied by any other administrator privilege

  • can_post_messages – Pass True if the administrator can create channel posts, channels only

  • can_edit_messages – Pass True if the administrator can edit messages of other users and can pin messages, channels only

  • can_delete_messages – Pass True if the administrator can delete messages of other users

  • can_manage_video_chats – Pass True if the administrator can manage video chats

  • can_restrict_members – Pass True if the administrator can restrict, ban or unban chat members

  • can_promote_members – Pass True if the administrator can add new administrators with a subset of their own privileges or demote administrators that he has promoted, directly or indirectly (promoted by administrators that were appointed by him)

  • can_change_info – Pass True if the administrator can change chat title, photo and other settings

  • can_invite_users – Pass True if the administrator can invite new users to the chat

  • can_pin_messages – Pass True if the administrator can pin messages, supergroups only

  • can_manage_topics – Pass True if the user is allowed to create, rename, close, and reopen forum topics, supergroups only

Returns:

instance of method aiogram.methods.promote_chat_member.PromoteChatMember

restrict(user_id: int, permissions: ChatPermissions, until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, **kwargs: Any) RestrictChatMember[source]#

Shortcut for method aiogram.methods.restrict_chat_member.RestrictChatMember will automatically fill method attributes:

  • chat_id

Use this method to restrict a user in a supergroup. The bot must be an administrator in the supergroup for this to work and must have the appropriate administrator rights. Pass True for all permissions to lift restrictions from a user. Returns True on success.

Source: https://core.telegram.org/bots/api#restrictchatmember

Parameters:
  • user_id – Unique identifier of the target user

  • permissions – A JSON-serialized object for new user permissions

  • until_date – Date when restrictions will be lifted for the user, unix time. If user is restricted for more than 366 days or less than 30 seconds from the current time, they are considered to be restricted forever

Returns:

instance of method aiogram.methods.restrict_chat_member.RestrictChatMember

unban(user_id: int, only_if_banned: Optional[bool] = None, **kwargs: Any) UnbanChatMember[source]#

Shortcut for method aiogram.methods.unban_chat_member.UnbanChatMember will automatically fill method attributes:

  • chat_id

Use this method to unban a previously banned user in a supergroup or channel. The user will not return to the group or channel automatically, but will be able to join via link, etc. The bot must be an administrator for this to work. By default, this method guarantees that after the call the user is not a member of the chat, but will be able to join it. So if the user is a member of the chat they will also be removed from the chat. If you don’t want this, use the parameter only_if_banned. Returns True on success.

Source: https://core.telegram.org/bots/api#unbanchatmember

Parameters:
  • user_id – Unique identifier of the target user

  • only_if_banned – Do nothing if the user is not banned

Returns:

instance of method aiogram.methods.unban_chat_member.UnbanChatMember

ban(user_id: int, until_date: Optional[Union[datetime.datetime, datetime.timedelta, int]] = None, revoke_messages: Optional[bool] = None, **kwargs: Any) BanChatMember[source]#

Shortcut for method aiogram.methods.ban_chat_member.BanChatMember will automatically fill method attributes:

  • chat_id

Use this method to ban a user in a group, a supergroup or a channel. In the case of supergroups and channels, the user will not be able to return to the chat on their own using invite links, etc., unless unbanned first. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#banchatmember

Parameters:
  • user_id – Unique identifier of the target user

  • until_date – Date when the user will be unbanned, unix time. If user is banned for more than 366 days or less than 30 seconds from the current time they are considered to be banned forever. Applied for supergroups and channels only.

  • revoke_messages – Pass True to delete all messages from the chat for the user that is being removed. If False, the user will be able to see messages in the group that were sent before the user was removed. Always True for supergroups and channels.

Returns:

instance of method aiogram.methods.ban_chat_member.BanChatMember

set_description(description: Optional[str] = None, **kwargs: Any) SetChatDescription[source]#

Shortcut for method aiogram.methods.set_chat_description.SetChatDescription will automatically fill method attributes:

  • chat_id

Use this method to change the description of a group, a supergroup or a channel. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#setchatdescription

Parameters:

description – New chat description, 0-255 characters

Returns:

instance of method aiogram.methods.set_chat_description.SetChatDescription

set_title(title: str, **kwargs: Any) SetChatTitle[source]#

Shortcut for method aiogram.methods.set_chat_title.SetChatTitle will automatically fill method attributes:

  • chat_id

Use this method to change the title of a chat. Titles can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#setchattitle

Parameters:

title – New chat title, 1-128 characters

Returns:

instance of method aiogram.methods.set_chat_title.SetChatTitle

delete_photo(**kwargs: Any) DeleteChatPhoto[source]#

Shortcut for method aiogram.methods.delete_chat_photo.DeleteChatPhoto will automatically fill method attributes:

  • chat_id

Use this method to delete a chat photo. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#deletechatphoto

Returns:

instance of method aiogram.methods.delete_chat_photo.DeleteChatPhoto

set_photo(photo: InputFile, **kwargs: Any) SetChatPhoto[source]#

Shortcut for method aiogram.methods.set_chat_photo.SetChatPhoto will automatically fill method attributes:

  • chat_id

Use this method to set a new profile photo for the chat. Photos can’t be changed for private chats. The bot must be an administrator in the chat for this to work and must have the appropriate administrator rights. Returns True on success.

Source: https://core.telegram.org/bots/api#setchatphoto

Parameters:

photo – New chat photo, uploaded using multipart/form-data

Returns:

instance of method aiogram.methods.set_chat_photo.SetChatPhoto