tgram.bound package¶
Submodules¶
tgram.bound.callback_query module¶
- class tgram.bound.callback_query.CallbackB[source]¶
Bases:
object
- answer(text: str = None, show_alert: bool = None, url: str = None, cache_time: int = None) bool [source]¶
- edit_message_live_location(latitude: float, longitude: float, live_period: int = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_message_media(media: tgram.types.InputMedia, reply_markup: tgram.types.InlineKeyboardMarkup = None) tgram.types.Message | bool [source]¶
- edit_message_reply_markup(reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_message_text(text: str, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
tgram.bound.message module¶
- class tgram.bound.message.MessageB[source]¶
Bases:
object
- copy(chat_id: int | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, reply_parameters: ReplyParameters = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) MessageId [source]¶
- edit(text: str, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None) Message | bool ¶
- edit_live_location(latitude: float, longitude: float, live_period: int = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_media(media: tgram.types.InputMedia, reply_markup: tgram.types.InlineKeyboardMarkup = None) tgram.types.Message | bool [source]¶
- edit_reply_markup(reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_text(text: str, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- property file_id: str¶
- forward(chat_id: int | str, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None) Message [source]¶
- property id: int¶
- property link: str | None¶
- property media: Literal['audio', 'video', 'photo', 'animation', 'voice', 'video_note', 'sticker', 'document'] | None¶
- react(reaction: List[tgram.types.ReactionType] | tgram.types.ReactionType | List[str] | str) bool [source]¶
- reply(text: str, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message ¶
- reply_animation(animation: Path | bytes | str, message_thread_id: int = None, duration: int = None, width: int = None, height: int = None, thumbnail: Path | bytes | str = None, caption: str = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_audio(audio: Path | bytes | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, duration: int = None, performer: str = None, title: str = None, thumbnail: Path | bytes | str = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_contact(phone_number: str, first_name: str, last_name: str = None, vcard: str = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_dice(emoji: str = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_document(document: Path | bytes | str, message_thread_id: int = None, thumbnail: Path | bytes | str = None, caption: str = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, disable_content_type_detection: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_game(game_short_name: str, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup = None) Message [source]¶
- reply_invoice(title: str, description: str, payload: str, currency: str, prices: List[LabeledPrice], provider_token: str = None, max_tip_amount: int = None, suggested_tip_amounts: List[int] = None, start_parameter: str = None, provider_data: str = None, 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, send_phone_number_to_provider: bool = None, send_email_to_provider: bool = None, is_flexible: bool = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup = None) Message [source]¶
- reply_location(latitude: float, longitude: float, message_thread_id: int = None, horizontal_accuracy: float = None, live_period: int = None, heading: int = None, proximity_alert_radius: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_media_from_file_id(file_id: str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_media_group(media: List[tgram.types.InputMedia], message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None) tgram.types.Message [source]¶
- reply_paid_media(star_count: int, media: List[tgram.types.InputPaidMedia], caption: str = None, parse_mode: tgram.types.ParseMode = None, caption_entities: List[tgram.types.MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, reply_markup: tgram.types.InlineKeyboardMarkup | tgram.types.ReplyKeyboardMarkup | tgram.types.ReplyKeyboardRemove | tgram.types.ForceReply = None) tgram.types.Message [source]¶
- reply_photo(photo: Path | bytes | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_sticker(sticker: Path | bytes | str, emoji: str = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_text(text: str, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_video(video: Path | bytes | str, message_thread_id: int = None, duration: int = None, width: int = None, height: int = None, thumbnail: Path | bytes | str = None, caption: str = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, supports_streaming: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_video_note(video_note: Path | bytes | str, message_thread_id: int = None, duration: int = None, length: int = None, thumbnail: Path | bytes | str = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_voice(voice: Path | bytes | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, duration: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- property service: Literal['video_chat_participants_invited', 'video_chat_ended', 'video_chat_started', 'video_chat_scheduled', 'giveaway_completed', 'general_forum_topic_unhidden', 'general_forum_topic_hidden', 'forum_topic_reopened', 'forum_topic_closed', 'forum_topic_edited', 'forum_topic_created', 'chat_background_set', 'boost_added', 'proximity_alert_triggered', 'write_access_allowed', 'successful_payment', 'refunded_payment', 'users_shared', 'chat_shared', 'pinned_message', 'message_auto_delete_timer_changed', 'channel_chat_created', 'supergroup_chat_created', 'group_chat_created', 'delete_chat_photo', 'new_chat_photo', 'new_chat_title', 'left_chat_member', 'new_chat_members'] | None¶
tgram.bound.user module¶
Module contents¶
- class tgram.bound.CallbackB[source]¶
Bases:
object
- answer(text: str = None, show_alert: bool = None, url: str = None, cache_time: int = None) bool [source]¶
- edit_message_live_location(latitude: float, longitude: float, live_period: int = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_message_media(media: tgram.types.InputMedia, reply_markup: tgram.types.InlineKeyboardMarkup = None) tgram.types.Message | bool [source]¶
- edit_message_reply_markup(reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_message_text(text: str, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- class tgram.bound.ChatB[source]¶
Bases:
object
- property full_name: str¶
- restrict_member(user_id: int, permissions: ChatPermissions, use_independent_chat_permissions: bool = None, until_date: int = None) bool [source]¶
- class tgram.bound.InlineQueryB[source]¶
Bases:
object
- answer(results: List[tgram.types.InlineQueryResult], cache_time: int = None, is_personal: bool = None, next_offset: str = None, button: tgram.types.InlineQueryResultsButton = None) bool [source]¶
- class tgram.bound.MessageB[source]¶
Bases:
object
- copy(chat_id: int | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, reply_parameters: ReplyParameters = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) MessageId [source]¶
- edit(text: str, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None) Message | bool ¶
- edit_live_location(latitude: float, longitude: float, live_period: int = None, horizontal_accuracy: float = None, heading: int = None, proximity_alert_radius: int = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_media(media: tgram.types.InputMedia, reply_markup: tgram.types.InlineKeyboardMarkup = None) tgram.types.Message | bool [source]¶
- edit_reply_markup(reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- edit_text(text: str, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, reply_markup: InlineKeyboardMarkup = None) Message | bool [source]¶
- property file_id: str¶
- forward(chat_id: int | str, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None) Message [source]¶
- property id: int¶
- property link: str | None¶
- property media: Literal['audio', 'video', 'photo', 'animation', 'voice', 'video_note', 'sticker', 'document'] | None¶
- react(reaction: List[tgram.types.ReactionType] | tgram.types.ReactionType | List[str] | str) bool [source]¶
- reply(text: str, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message ¶
- reply_animation(animation: Path | bytes | str, message_thread_id: int = None, duration: int = None, width: int = None, height: int = None, thumbnail: Path | bytes | str = None, caption: str = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_audio(audio: Path | bytes | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, duration: int = None, performer: str = None, title: str = None, thumbnail: Path | bytes | str = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_contact(phone_number: str, first_name: str, last_name: str = None, vcard: str = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_dice(emoji: str = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_document(document: Path | bytes | str, message_thread_id: int = None, thumbnail: Path | bytes | str = None, caption: str = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, disable_content_type_detection: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_game(game_short_name: str, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup = None) Message [source]¶
- reply_invoice(title: str, description: str, payload: str, currency: str, prices: List[LabeledPrice], provider_token: str = None, max_tip_amount: int = None, suggested_tip_amounts: List[int] = None, start_parameter: str = None, provider_data: str = None, 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, send_phone_number_to_provider: bool = None, send_email_to_provider: bool = None, is_flexible: bool = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup = None) Message [source]¶
- reply_location(latitude: float, longitude: float, message_thread_id: int = None, horizontal_accuracy: float = None, live_period: int = None, heading: int = None, proximity_alert_radius: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_media_from_file_id(file_id: str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_media_group(media: List[tgram.types.InputMedia], message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None) tgram.types.Message [source]¶
- reply_paid_media(star_count: int, media: List[tgram.types.InputPaidMedia], caption: str = None, parse_mode: tgram.types.ParseMode = None, caption_entities: List[tgram.types.MessageEntity] = None, show_caption_above_media: bool = None, disable_notification: bool = None, protect_content: bool = None, reply_markup: tgram.types.InlineKeyboardMarkup | tgram.types.ReplyKeyboardMarkup | tgram.types.ReplyKeyboardRemove | tgram.types.ForceReply = None) tgram.types.Message [source]¶
- reply_photo(photo: Path | bytes | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_sticker(sticker: Path | bytes | str, emoji: str = None, message_thread_id: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_text(text: str, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, entities: List[MessageEntity] = None, link_preview_options: LinkPreviewOptions = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_video(video: Path | bytes | str, message_thread_id: int = None, duration: int = None, width: int = None, height: int = None, thumbnail: Path | bytes | str = None, caption: str = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, show_caption_above_media: bool = None, has_spoiler: bool = None, supports_streaming: bool = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_video_note(video_note: Path | bytes | str, message_thread_id: int = None, duration: int = None, length: int = None, thumbnail: Path | bytes | str = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- reply_voice(voice: Path | bytes | str, caption: str = None, message_thread_id: int = None, parse_mode: Literal['Markdown', 'MarkdownV2', 'HTML', 'Disable'] = None, caption_entities: List[MessageEntity] = None, duration: int = None, disable_notification: bool = None, protect_content: bool = None, message_effect_id: str = None, reply_markup: InlineKeyboardMarkup | ReplyKeyboardMarkup | ReplyKeyboardRemove | ForceReply = None) Message [source]¶
- property service: Literal['video_chat_participants_invited', 'video_chat_ended', 'video_chat_started', 'video_chat_scheduled', 'giveaway_completed', 'general_forum_topic_unhidden', 'general_forum_topic_hidden', 'forum_topic_reopened', 'forum_topic_closed', 'forum_topic_edited', 'forum_topic_created', 'chat_background_set', 'boost_added', 'proximity_alert_triggered', 'write_access_allowed', 'successful_payment', 'refunded_payment', 'users_shared', 'chat_shared', 'pinned_message', 'message_auto_delete_timer_changed', 'channel_chat_created', 'supergroup_chat_created', 'group_chat_created', 'delete_chat_photo', 'new_chat_photo', 'new_chat_title', 'left_chat_member', 'new_chat_members'] | None¶