telegram.Chat¶
-
class
telegram.
Chat
(id: int, type: str, title: str = None, username: str = None, first_name: str = None, last_name: str = None, bot: Bot = None, photo: telegram.files.chatphoto.ChatPhoto = None, description: str = None, invite_link: str = None, pinned_message: Message = None, permissions: telegram.chatpermissions.ChatPermissions = None, sticker_set_name: str = None, can_set_sticker_set: bool = None, slow_mode_delay: int = None, bio: str = None, linked_chat_id: int = None, location: telegram.chatlocation.ChatLocation = None, **_kwargs)¶ Bases:
telegram.base.TelegramObject
This object represents a chat.
Objects of this class are comparable in terms of equality. Two objects of this class are considered equal, if their
id
is equal.Parameters: - id (
int
) – Unique identifier for this chat. This number 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. - type (
str
) – Type of chat, can be either ‘private’, ‘group’, ‘supergroup’ or ‘channel’. - title (
str
, optional) – Title, for supergroups, channels and group chats. - username (
str
, optional) – Username, for private chats, supergroups and channels if available. - first_name (
str
, optional) – First name of the other party in a private chat. - last_name (
str
, optional) – Last name of the other party in a private chat. - photo (
telegram.ChatPhoto
, optional) – Chat photo. Returned only intelegram.Bot.get_chat()
. - bio (
str
, optional) – Bio of the other party in a private chat. Returned only intelegram.Bot.get_chat()
. - description (
str
, optional) – Description, for groups, supergroups and channel chats. Returned only intelegram.Bot.get_chat()
. - invite_link (
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 usingexport_chat_invite_link()
. Returned only intelegram.Bot.get_chat()
. - pinned_message (
telegram.Message
, optional) – The most recent pinned message (by sending date). Returned only intelegram.Bot.get_chat()
. - permissions (
telegram.ChatPermissions
) – Optional. Default chat member permissions, for groups and supergroups. Returned only intelegram.Bot.get_chat()
. - slow_mode_delay (
int
, optional) – For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. Returned only intelegram.Bot.get_chat()
. - bot (
telegram.Bot
, optional) – The Bot to use for instance methods. - sticker_set_name (
str
, optional) – For supergroups, name of group sticker set. Returned only intelegram.Bot.get_chat()
. - can_set_sticker_set (
bool
, optional) –True
, if the bot can change group the sticker set. Returned only intelegram.Bot.get_chat()
. - linked_chat_id (
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. Returned only intelegram.Bot.get_chat()
. - location (
telegram.ChatLocation
, optional) – For supergroups, the location to which the supergroup is connected. Returned only intelegram.Bot.get_chat()
. - **kwargs (
dict
) – Arbitrary keyword arguments.
-
id
¶ Unique identifier for this chat.
Type: int
-
type
¶ Type of chat.
Type: str
-
title
¶ Optional. Title, for supergroups, channels and group chats.
Type: str
-
username
¶ Optional. Username.
Type: str
-
first_name
¶ Optional. First name of the other party in a private chat.
Type: str
-
last_name
¶ Optional. Last name of the other party in a private chat.
Type: str
-
photo
¶ Optional. Chat photo.
Type: telegram.ChatPhoto
-
bio
¶ Optional. Bio of the other party in a private chat. Returned only in
telegram.Bot.get_chat()
.Type: str
-
description
¶ Optional. Description, for groups, supergroups and channel chats.
Type: str
-
invite_link
¶ Optional. Chat invite link, for supergroups and channel chats.
Type: str
-
pinned_message
¶ Optional. The most recent pinned message (by sending date). Returned only in
telegram.Bot.get_chat()
.Type: telegram.Message
-
permissions
¶ Optional. Default chat member permissions, for groups and supergroups. Returned only in
telegram.Bot.get_chat()
.Type: telegram.ChatPermissions
-
slow_mode_delay
¶ Optional. For supergroups, the minimum allowed delay between consecutive messages sent by each unprivileged user. Returned only in
telegram.Bot.get_chat()
.Type: int
-
sticker_set_name
¶ Optional. For supergroups, name of Group sticker set.
Type: str
-
can_set_sticker_set
¶ Optional.
True
, if the bot can change group the sticker set.Type: bool
-
linked_chat_id
¶ Optional. Unique identifier for the linked chat, i.e. the discussion group identifier for a channel and vice versa; for supergroups and channel chats. Returned only in
telegram.Bot.get_chat()
.Type: int
-
location
¶ Optional. For supergroups, the location to which the supergroup is connected. Returned only in
telegram.Bot.get_chat()
.Type: telegram.ChatLocation
-
CHANNEL
= 'channel'¶
-
GROUP
= 'group'¶
-
PRIVATE
= 'private'¶
-
SUPERGROUP
= 'supergroup'¶
-
copy_message
(chat_id: Union[int, str], message_id: Union[str, int], caption: str = None, parse_mode: Union[DefaultValue[DVType], str, None] = None, caption_entities: Union[Tuple[MessageEntity, ...], List[MessageEntity]] = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → MessageId¶ Shortcut for:
bot.copy_message(from_chat_id=update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.copy_message()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
full_name
¶ Convenience property. If
first_name
is notNone
gives,first_name
followed by (if available)last_name
.Note
full_name
will always beNone
, if the chat is a (super)group or channel.New in version 13.2.
Type: str
-
get_administrators
(timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → List[ChatMember]¶ Shortcut for:
bot.get_chat_administrators(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.get_chat_administrators()
.Returns: A list of administrators in a chat. An Array of telegram.ChatMember
objects that contains information about all chat administrators except other bots. If the chat is a group or a supergroup and no administrators were appointed, only the creator will be returned.Return type: List[ telegram.ChatMember
]
-
get_member
(user_id: Union[str, int], timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → ChatMember¶ Shortcut for:
bot.get_chat_member(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.get_chat_member()
.Returns: telegram.ChatMember
-
get_members_count
(timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → int¶ Shortcut for:
bot.get_chat_members_count(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.get_chat_members_count()
.Returns: int
-
kick_member
(user_id: Union[str, int], timeout: Union[DefaultValue[DVType], float, None] = None, until_date: Union[int, datetime.datetime] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.kick_chat_member(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.kick_chat_member()
.Returns: If the action was sent successfully. Return type: bool
Note
This method will only work if the All Members Are Admins setting is off in the target group. Otherwise members may only be removed by the group’s creator or by the member that added them.
-
leave
(timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.leave_chat(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.leave_chat()
.Returns: bool
If the action was sent successfully.
-
pin_message
(message_id: Union[str, int], disable_notification: Union[DefaultValue[DVType], bool, None] = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.pin_chat_message(chat_id=update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.pin_chat_message()
.Returns: On success, True
is returned.Return type: bool
-
promote_member
(user_id: Union[str, int], can_change_info: bool = None, can_post_messages: bool = None, can_edit_messages: bool = None, can_delete_messages: bool = None, can_invite_users: bool = None, can_restrict_members: bool = None, can_pin_messages: bool = None, can_promote_members: bool = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None, is_anonymous: bool = None) → bool¶ Shortcut for:
bot.promote_chat_member(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.promote_chat_member()
.New in version 13.2.
Returns: If the action was sent successfully. Return type: bool
-
restrict_member
(user_id: Union[str, int], permissions: telegram.chatpermissions.ChatPermissions, until_date: Union[int, datetime.datetime] = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.restrict_chat_member(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.restrict_chat_member()
.New in version 13.2.
Returns: If the action was sent successfully. Return type: bool
-
send_action
(action: str, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Alias for
send_chat_action
-
send_animation
(animation: Union[str, bytes, IO, InputFile, pathlib.Path, Animation], duration: int = None, width: int = None, height: int = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, caption: str = None, parse_mode: Union[DefaultValue[DVType], str, None] = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None) → Message¶ Shortcut for:
bot.send_animation(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_animation()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_audio
(audio: Union[str, bytes, IO, InputFile, pathlib.Path, Audio], duration: int = None, performer: str = None, title: str = None, caption: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, parse_mode: Union[DefaultValue[DVType], str, None] = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None) → Message¶ Shortcut for:
bot.send_audio(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_audio()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_chat_action
(action: str, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.send_chat_action(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_chat_action()
.Returns: On success, True
is returned.Return type: bool
-
send_contact
(phone_number: str = None, first_name: str = None, last_name: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, contact: Contact = None, vcard: str = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_contact(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_contact()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_copy
(from_chat_id: Union[str, int], message_id: Union[str, int], caption: str = None, parse_mode: Union[DefaultValue[DVType], str, None] = None, caption_entities: Union[Tuple[MessageEntity, ...], List[MessageEntity]] = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → MessageId¶ Shortcut for:
bot.copy_message(chat_id=update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.copy_message()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_dice
(disable_notification: Union[DefaultValue[DVType], bool, None] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, emoji: str = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_dice(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_dice()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_document
(document: Union[str, bytes, IO, InputFile, pathlib.Path, Document], filename: str = None, caption: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, parse_mode: Union[DefaultValue[DVType], str, None] = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, disable_content_type_detection: bool = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None) → Message¶ Shortcut for:
bot.send_document(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_document()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_game
(game_short_name: str, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: InlineKeyboardMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_game(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_game()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_invoice
(title: str, description: str, payload: str, provider_token: str, start_parameter: str, currency: str, prices: List[LabeledPrice], photo_url: str = None, photo_size: int = None, photo_width: int = None, photo_height: int = None, need_name: bool = None, need_phone_number: bool = None, need_email: bool = None, need_shipping_address: bool = None, is_flexible: bool = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: InlineKeyboardMarkup = None, provider_data: Union[str, object] = None, send_phone_number_to_provider: bool = None, send_email_to_provider: bool = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_invoice(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_invoice()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_location
(latitude: float = None, longitude: float = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, location: Location = None, live_period: int = None, api_kwargs: Dict[str, Any] = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_location(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_location()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_media_group
(media: List[Union[InputMediaAudio, InputMediaDocument, InputMediaPhoto, InputMediaVideo]], disable_notification: Union[DefaultValue[DVType], bool, None] = None, reply_to_message_id: Union[int, str] = None, timeout: Union[DefaultValue[DVType], float] = 20, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → List[Message]¶ Shortcut for:
bot.send_media_group(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_media_group()
.Returns: ] On success, instance representing the message posted. Return type: List[ telegram.Message
-
send_message
(text: str, parse_mode: Union[DefaultValue[DVType], str, None] = None, disable_web_page_preview: Union[DefaultValue[DVType], bool, None] = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None) → Message¶ Shortcut for:
bot.send_message(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_message()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_photo
(photo: Union[str, bytes, IO, InputFile, pathlib.Path, PhotoSize], caption: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, parse_mode: Union[DefaultValue[DVType], str, None] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None) → Message¶ Shortcut for:
bot.send_photo(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_photo()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_poll
(question: str, options: List[str], is_anonymous: bool = True, type: str = 'regular', allows_multiple_answers: bool = False, correct_option_id: int = None, is_closed: bool = None, disable_notification: Union[DefaultValue[DVType], bool, None] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, explanation: str = None, explanation_parse_mode: Union[DefaultValue[DVType], str, None] = None, open_period: int = None, close_date: Union[int, datetime.datetime] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, explanation_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None) → Message¶ Shortcut for:
bot.send_poll(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_poll()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_sticker
(sticker: Union[str, bytes, IO, InputFile, pathlib.Path, Sticker], disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_sticker(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_sticker()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_venue
(latitude: float = None, longitude: float = None, title: str = None, address: str = None, foursquare_id: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float, None] = None, venue: Venue = None, foursquare_type: str = None, api_kwargs: Dict[str, Any] = None, google_place_id: str = None, google_place_type: str = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None) → Message¶ Shortcut for:
bot.send_venue(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_venue()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_video
(video: Union[str, bytes, IO, InputFile, pathlib.Path, Video], duration: int = None, caption: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, width: int = None, height: int = None, parse_mode: Union[DefaultValue[DVType], str, None] = None, supports_streaming: bool = None, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None) → Message¶ Shortcut for:
bot.send_video(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_video()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_video_note
(video_note: Union[str, bytes, IO, InputFile, pathlib.Path, VideoNote], duration: int = None, length: int = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, thumb: Union[str, bytes, IO, InputFile, pathlib.Path] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, filename: str = None) → Message¶ Shortcut for:
bot.send_video_note(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_video_note()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
send_voice
(voice: Union[str, bytes, IO, InputFile, pathlib.Path, Voice], duration: int = None, caption: str = None, disable_notification: Union[DefaultValue[DVType], bool] = None, reply_to_message_id: Union[int, str] = None, reply_markup: ReplyMarkup = None, timeout: Union[DefaultValue[DVType], float] = 20, parse_mode: Union[DefaultValue[DVType], str, None] = None, api_kwargs: Dict[str, Any] = None, allow_sending_without_reply: Union[DefaultValue[DVType], bool, None] = None, caption_entities: Union[List[MessageEntity], Tuple[MessageEntity, ...]] = None, filename: str = None) → Message¶ Shortcut for:
bot.send_voice(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.send_voice()
.Returns: On success, instance representing the message posted. Return type: telegram.Message
-
set_administrator_custom_title
(user_id: Union[int, str], custom_title: str, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.set_chat_administrator_custom_title(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.set_chat_administrator_custom_title()
.Returns:
bool
: If the action was sent successfully.
-
set_permissions
(permissions: telegram.chatpermissions.ChatPermissions, timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.set_chat_permissions(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.set_chat_permissions()
.Returns: If the action was sent successfully. Return type: bool
-
unban_member
(user_id: Union[str, int], timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None, only_if_banned: bool = None) → bool¶ Shortcut for:
bot.unban_chat_member(update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.unban_chat_member()
.Returns: If the action was sent successfully. Return type: bool
-
unpin_all_messages
(timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None) → bool¶ Shortcut for:
bot.unpin_all_chat_messages(chat_id=update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.unpin_all_chat_messages()
.Returns: On success, True
is returned.Return type: bool
-
unpin_message
(timeout: Union[DefaultValue[DVType], float, None] = None, api_kwargs: Dict[str, Any] = None, message_id: Union[str, int] = None) → bool¶ Shortcut for:
bot.unpin_chat_message(chat_id=update.effective_chat.id, *args, **kwargs)
For the documentation of the arguments, please see
telegram.Bot.unpin_chat_message()
.Returns: On success, True
is returned.Return type: bool
- id (