Contents Menu Expand Light mode Dark mode Auto light/dark, in light mode Auto light/dark, in dark mode Skip to content
wzgram
Logo
w z g r a m

Introduction

  • Install Guide
  • Quick Start

Getting Started

  • Project Setup
  • Authorization
  • Invoking Methods
  • Handling Updates
  • Error Handling
  • Examples
    • hello_world
    • echo_bot
    • business_echo_bot
    • welcome_bot
    • get_history
    • get_chat_members
    • get_dialogs
    • callback_queries
    • inline_queries
    • use_inline_bots
    • bot_keyboards
    • send_voice
    • raw_updates
    • guest_message_echo_bot
    • conversation_bot
    • ephemeral_message_bot
    • rich_message

Features

  • Features
    • Business Accounts
    • Paid Media
    • Gifts and Stars
    • Stories
    • Checklists
    • Suggested Posts
    • Direct Messages in Channels
    • Topics and Drafts
    • Text Entities and Button Styling
    • Polls
    • Guest Mode and Managed Bots
    • Rich Messages
    • Ephemeral Messages
    • Communities
    • Listeners
    • Rate Limiting
    • Session Strings
    • Performance and Resource Budgets

API Reference

  • Client
  • Available Methods
    • ask
    • listen
    • register_next_step_handler
    • stop_listening
    • wait_for_callback_query
    • wait_for_message
    • add_handler
    • export_session_string
    • remove_handler
    • restart
    • run
    • set_parse_mode
    • start
    • stop
    • stop_transmission
    • idle()
    • compose()
    • add_profile_audio
    • get_account_ttl
    • get_global_privacy_settings
    • get_privacy
    • remove_profile_audio
    • set_account_ttl
    • set_global_privacy_settings
    • set_inactive_session_ttl
    • set_privacy
    • set_profile_audio_position
    • add_checklist_tasks
    • add_poll_option
    • add_to_gifs
    • approve_suggested_post
    • compose_text_with_ai
    • copy_media_group
    • copy_message
    • decline_suggested_post
    • delete_chat_history
    • delete_direct_messages_chat_topic_history
    • delete_ephemeral_message
    • delete_messages
    • delete_participant_reaction
    • delete_participant_reactions
    • delete_poll_option
    • delete_scheduled_messages
    • download_media
    • edit_fact_check
    • edit_inline_caption
    • edit_inline_media
    • edit_inline_reply_markup
    • edit_inline_text
    • edit_message_caption
    • edit_message_checklist
    • edit_message_media
    • edit_message_reply_markup
    • edit_message_text
    • fix_text_with_ai
    • forward_media_group
    • forward_messages
    • get_available_effects
    • get_chat_history
    • get_chat_history_count
    • get_custom_emoji_stickers
    • get_direct_messages_chat_topic_history
    • get_discussion_message
    • get_discussion_replies
    • get_discussion_replies_count
    • get_main_web_app
    • get_media_group
    • get_messages
    • get_poll_results
    • get_poll_stats
    • get_scheduled_messages
    • get_stickers
    • get_user_personal_chat_messages
    • get_web_app_link_url
    • get_web_app_url
    • mark_checklist_tasks_as_done
    • open_web_app
    • read_chat_history
    • read_mentions
    • read_reactions
    • retract_vote
    • search_global
    • search_global_count
    • search_messages
    • search_messages_count
    • send_animation
    • send_audio
    • send_cached_media
    • send_chat_action
    • send_checklist
    • send_contact
    • send_dice
    • send_document
    • send_ephemeral_message
    • send_location
    • send_media_group
    • send_message
    • send_paid_media
    • send_photo
    • send_poll
    • send_reaction
    • send_rich_message
    • send_rich_message_draft
    • send_scheduled_messages
    • send_screenshot_notification
    • send_sticker
    • send_venue
    • send_video
    • send_video_note
    • send_voice
    • stop_poll
    • stream_media
    • summarize_text
    • translate_text
    • view_messages
    • vote_poll
    • add_chat_members
    • archive_chats
    • ban_chat_member
    • close_forum_topic
    • create_channel
    • create_forum_topic
    • create_group
    • create_supergroup
    • delete_all_message_reactions
    • delete_channel
    • delete_chat_photo
    • delete_forum_topic
    • delete_message_reaction
    • delete_supergroup
    • delete_user_history
    • edit_forum_topic
    • get_chat
    • get_chat_event_log
    • get_chat_member
    • get_chat_members
    • get_chat_members_count
    • get_chat_online_count
    • get_chat_settings
    • get_dialogs
    • get_dialogs_count
    • get_direct_messages_topics
    • get_direct_messages_topics_by_id
    • get_forum_topics
    • get_forum_topics_by_id
    • get_nearby_chats
    • get_personal_channels
    • get_send_as_chats
    • get_similar_channels
    • get_suitable_discussion_chats
    • get_top_chats
    • join_chat
    • leave_chat
    • mark_chat_unread
    • pin_chat_message
    • promote_chat_member
    • restrict_chat_member
    • restrict_sponsored_messages
    • set_administrator_title
    • set_chat_description
    • set_chat_permissions
    • set_chat_photo
    • set_chat_protected_content
    • set_chat_title
    • set_chat_ttl
    • set_chat_username
    • set_send_as_chat
    • set_slow_mode
    • toggle_anti_spam
    • toggle_auto_translation
    • toggle_forum
    • toggle_join_to_send
    • toggle_participants_hidden
    • toggle_pre_history_hidden
    • toggle_signatures
    • toggle_slow_mode
    • toggle_view_forum_as_messages
    • unarchive_chats
    • unban_chat_member
    • unpin_all_chat_messages
    • unpin_chat_message
    • update_channel_color
    • update_chat_notifications
    • block_user
    • check_username
    • delete_profile_photos
    • get_chat_audios
    • get_chat_audios_count
    • get_chat_photos
    • get_chat_photos_count
    • get_common_chats
    • get_default_emoji_statuses
    • get_me
    • get_users
    • set_emoji_status
    • set_personal_channel
    • set_profile_photo
    • set_username
    • unblock_user
    • update_birthday
    • update_profile
    • update_status
    • approve_all_chat_join_requests
    • approve_chat_join_request
    • create_chat_invite_link
    • decline_all_chat_join_requests
    • decline_chat_join_request
    • delete_chat_admin_invite_links
    • delete_chat_invite_link
    • edit_chat_invite_link
    • export_chat_invite_link
    • get_chat_admin_invite_links
    • get_chat_admin_invite_links_count
    • get_chat_admins_with_invite_links
    • get_chat_invite_link
    • get_chat_invite_link_joiners
    • get_chat_invite_link_joiners_count
    • get_chat_join_requests
    • revoke_chat_invite_link
    • add_contact
    • delete_contacts
    • get_blocked_message_senders
    • get_contacts
    • get_contacts_count
    • import_contacts
    • search_contacts
    • set_contact_note
    • check_chat_folder_invite_link
    • create_folder
    • create_folder_invite_link
    • delete_folder
    • delete_folder_invite_link
    • edit_folder
    • edit_folder_invite_link
    • get_chats_for_folder_invite_link
    • get_folder_invite_links
    • get_folders
    • join_folder
    • leave_folder
    • change_cloud_password
    • enable_cloud_password
    • remove_cloud_password
    • allow_bot_send_message
    • answer_callback_query
    • answer_chat_join_request_query
    • answer_guest_query
    • answer_inline_query
    • answer_pre_checkout_query
    • answer_shipping_query
    • answer_web_app_query
    • can_bot_send_message
    • check_bot_username
    • create_bot
    • create_invoice_link
    • delete_bot_commands
    • edit_user_star_subscription
    • get_admined_bots
    • get_bot_commands
    • get_bot_default_privileges
    • get_bot_info
    • get_bot_info_description
    • get_bot_info_short_description
    • get_bot_name
    • get_chat_menu_button
    • get_game_high_scores
    • get_inline_bot_results
    • get_managed_bot_access_settings
    • get_managed_bot_token
    • get_owned_bots
    • refund_star_payment
    • replace_managed_bot_token
    • request_callback_answer
    • send_chat_join_request_web_app
    • send_game
    • send_inline_bot_result
    • send_invoice
    • set_bot_commands
    • set_bot_default_privileges
    • set_bot_info_description
    • set_bot_info_short_description
    • set_bot_name
    • set_chat_menu_button
    • set_game_score
    • set_managed_bot_access_settings
    • create_business_chat_link
    • delete_business_chat_link
    • delete_business_messages
    • get_business_account_gifts
    • get_business_account_star_balance
    • get_business_chat_links
    • get_business_connection
    • get_connected_bots
    • resolve_business_chat_link
    • transfer_business_account_stars
    • update_business_away_message
    • update_business_greeting_message
    • update_business_intro
    • update_business_location
    • update_business_work_hours
    • add_collection_gifts
    • apply_gift_code
    • buy_gift_upgrade
    • check_gift_code
    • convert_gift_to_stars
    • craft_gift
    • create_gift_collection
    • delete_gift_collection
    • drop_gift_original_details
    • edit_star_subscription
    • get_available_gifts
    • get_chat_gifts
    • get_chat_gifts_count
    • get_gift_auction_state
    • get_gift_collections
    • get_gift_upgrade_preview
    • get_gift_upgrade_variants
    • get_gifts_for_crafting
    • get_payment_form
    • get_stars_balance
    • get_ton_balance
    • get_upgraded_gift
    • get_upgraded_gift_value_info
    • gift_premium_with_stars
    • hide_gift
    • increase_gift_auction_bid
    • place_gift_auction_bid
    • process_gift_purchase_offer
    • remove_collection_gifts
    • reorder_collection_gifts
    • reorder_gift_collections
    • reuse_star_subscription
    • search_gifts_for_resale
    • send_gift
    • send_gift_purchase_offer
    • send_payment_form
    • send_resold_gift
    • set_gift_collection_name
    • set_gift_resale_price
    • set_pinned_gifts
    • show_gift
    • suggest_birthday
    • transfer_gift
    • upgrade_gift
    • can_post_stories
    • copy_story
    • delete_stories
    • edit_story_caption
    • edit_story_media
    • edit_story_privacy
    • enable_stealth_mode
    • forward_story
    • get_all_stories
    • get_archived_stories
    • get_chat_stories
    • get_pinned_stories
    • get_stories
    • get_story_views
    • hide_chat_stories
    • pin_chat_stories
    • read_chat_stories
    • send_story
    • show_chat_stories
    • unpin_chat_stories
    • view_stories
    • get_call_members
    • apply_boost
    • get_boosts
    • get_boosts_status
    • on_business_connection
    • on_business_message
    • on_callback_query
    • on_chat_boost
    • on_chat_join_request
    • on_chat_member_updated
    • on_chosen_inline_result
    • on_connect
    • on_deleted_business_messages
    • on_deleted_messages
    • on_disconnect
    • on_edited_business_message
    • on_edited_message
    • on_error
    • on_guest_message
    • on_inline_query
    • on_managed_bot
    • on_message
    • on_message_reaction
    • on_message_reaction_count
    • on_poll
    • on_pre_checkout_query
    • on_purchased_paid_media
    • on_raw_update
    • on_shipping_query
    • on_start
    • on_stop
    • on_story
    • on_user_status
    • accept_terms_of_service
    • change_phone_number
    • check_password
    • connect
    • disconnect
    • get_active_sessions
    • get_password_hint
    • initialize
    • log_out
    • recover_password
    • resend_code
    • resend_phone_number_code
    • reset_session
    • reset_sessions
    • send_code
    • send_phone_number_code
    • send_recovery_code
    • sign_in
    • sign_in_bot
    • sign_up
    • terminate
    • get_session
    • invoke
    • recover_gaps
    • resolve_peer
    • save_file
    • set_dc
  • Available Types
    • User
    • Chat
    • ChatPreview
    • ChatPhoto
    • ChatMember
    • ChatPermissions
    • ChatPrivileges
    • ChatLocation
    • ChatInviteLink
    • ChatAdminWithInviteLinks
    • ChatEvent
    • ChatEventFilter
    • ChatMemberUpdated
    • ChatJoinRequest
    • ChatJoiner
    • Dialog
    • Restriction
    • EmojiStatus
    • Birthday
    • BusinessConnection
    • BusinessIntro
    • BusinessRecipients
    • BusinessWorkingHours
    • BusinessWeeklyOpen
    • ChatAdministratorRights
    • ChatColor
    • ChatJoinResult
    • ChatSettings
    • Folder
    • FolderInviteLink
    • FoundContacts
    • GlobalPrivacySettings
    • GroupCallMember
    • HistoryCleared
    • InviteLinkImporter
    • PhoneCallEnded
    • PhoneCallStarted
    • PrivacyRule
    • StoriesStealthMode
    • UserRating
    • AcceptedGiftTypes
    • BotVerification
    • BusinessBotRights
    • ChatFolderInviteLinkInfo
    • ChatFullInfo
    • ChatJoinResultDeclined
    • ChatJoinResultGuardBotApprovalRequired
    • ChatJoinResultRequestSent
    • ChatJoinResultSuccess
    • Community
    • CommunityChatAdded
    • CommunityChatRemoved
    • FailedToAddMember
    • Link
    • Username
    • VerificationStatus
    • Message
    • MessageEntity
    • Photo
    • Thumbnail
    • Audio
    • Document
    • Animation
    • Video
    • Voice
    • VideoNote
    • Contact
    • Location
    • Venue
    • Sticker
    • Game
    • WebPage
    • Poll
    • PollOption
    • Dice
    • Reaction
    • VideoChatScheduled
    • VideoChatStarted
    • VideoChatEnded
    • VideoChatMembersInvited
    • WebAppData
    • MessageReactions
    • ChatReactions
    • AvailableEffect
    • BoostsStatus
    • BusinessMessage
    • ChatBackground
    • ChatBoost
    • Checklist
    • ChecklistTask
    • ChecklistTasksAdded
    • ChecklistTasksDone
    • ContactRegistered
    • DirectMessagePriceChanged
    • DirectMessagesTopic
    • ExternalReplyInfo
    • FactCheck
    • FormattedText
    • ForumTopic
    • ForumTopicClosed
    • ForumTopicCreated
    • ForumTopicEdited
    • ForumTopicReopened
    • GeneralForumTopicHidden
    • GeneralForumTopicUnhidden
    • Gift
    • GiftAttribute
    • GiftBackground
    • GiftAuction
    • GiftAuctionState
    • GiftCollection
    • GiftedPremium
    • GiftedStars
    • GiftedTon
    • Giveaway
    • GiveawayCompleted
    • GiveawayCreated
    • GiveawayPrizeStars
    • GiveawayWinners
    • InputChecklistTask
    • Invoice
    • LinkPreviewOptions
    • LivePhoto
    • ManagedBotCreated
    • MaskPosition
    • MediaArea
    • MessageContent
    • MessageOrigin
    • MessageOriginChannel
    • MessageOriginChat
    • MessageOriginHiddenUser
    • MessageOriginImport
    • MessageOriginUser
    • MyBoost
    • PaidMediaInfo
    • PaidMediaPreview
    • PaidMessagesPriceChanged
    • PaidMessagesRefunded
    • PaidReactor
    • PaymentForm
    • PaymentOption
    • PollOptionAdded
    • PollOptionDeleted
    • PremiumGiftCode
    • ProximityAlertTriggered
    • RefundedPayment
    • ReplyParameters
    • RestrictionReason
    • RichBlock
    • RichMessage
    • RichText
    • ScreenshotTaken
    • StarAmount
    • Story
    • StoryView
    • StrippedThumbnail
    • SuggestedPostApprovalFailed
    • SuggestedPostApproved
    • SuggestedPostDeclined
    • SuggestedPostInfo
    • SuggestedPostPaid
    • SuggestedPostParameters
    • SuggestedPostPrice
    • SuggestedPostRefunded
    • TextQuote
    • UpgradedGiftAttributeId
    • UpgradedGiftAttributeIdBackdrop
    • UpgradedGiftAttributeIdModel
    • UpgradedGiftAttributeIdSymbol
    • UpgradedGiftAttributeRarity
    • UpgradedGiftOriginalDetails
    • UpgradedGiftPurchaseOffer
    • UpgradedGiftValueInfo
    • WriteAccessAllowed
    • AuctionBid
    • AuctionRound
    • AuctionState
    • AuctionStateActive
    • AuctionStateFinished
    • ChatHasProtectedContentDisableRequested
    • ChatHasProtectedContentToggled
    • ChatOwnerChanged
    • ChatOwnerLeft
    • ChatTheme
    • CheckedGiftCode
    • CraftGiftResult
    • CraftGiftResultFail
    • CraftGiftResultSuccess
    • GiftPurchaseLimit
    • GiftResaleParameters
    • GiftResalePrice
    • GiftResalePriceStar
    • GiftResalePriceTon
    • GiftUpgradePreview
    • GiftUpgradePrice
    • GiftUpgradeVariants
    • PaymentResult
    • PollStats
    • RichBlockAnchor
    • RichBlockAnimation
    • RichBlockAudio
    • RichBlockBlockQuotation
    • RichBlockCaption
    • RichBlockCollage
    • RichBlockDetails
    • RichBlockDivider
    • RichBlockFooter
    • RichBlockList
    • RichBlockListItem
    • RichBlockMap
    • RichBlockMathematicalExpression
    • RichBlockParagraph
    • RichBlockPhoto
    • RichBlockPreformatted
    • RichBlockPullQuotation
    • RichBlockSectionHeading
    • RichBlockSlideshow
    • RichBlockTable
    • RichBlockTableCell
    • RichBlockThinking
    • RichBlockUnsupported
    • RichBlockVideo
    • RichBlockVoiceNote
    • RichTextAnchor
    • RichTextAnchorLink
    • RichTextBankCardNumber
    • RichTextBold
    • RichTextBotCommand
    • RichTextCashtag
    • RichTextCode
    • RichTextCustomEmoji
    • RichTextDateTime
    • RichTextDiff
    • RichTextEmailAddress
    • RichTextHashtag
    • RichTextImage
    • RichTextItalic
    • RichTextMarked
    • RichTextMathematicalExpression
    • RichTextMention
    • RichTextPhoneNumber
    • RichTextReference
    • RichTextReferenceLink
    • RichTextSpoiler
    • RichTextStrikethrough
    • RichTextSubscript
    • RichTextSuperscript
    • RichTextTextMention
    • RichTextUnderline
    • RichTextUrl
    • SavedCredentials
    • Str
    • SuccessfulPayment
    • SuggestedPostPriceStar
    • SuggestedPostPriceTon
    • UpgradedGiftAttributeRarityEpic
    • UpgradedGiftAttributeRarityLegendary
    • UpgradedGiftAttributeRarityPerMille
    • UpgradedGiftAttributeRarityRare
    • UpgradedGiftAttributeRarityUncommon
    • UpgradedGiftPurchaseOfferRejected
    • ReplyKeyboardMarkup
    • KeyboardButton
    • ReplyKeyboardRemove
    • InlineKeyboardMarkup
    • InlineKeyboardButton
    • CopyTextButton
    • SwitchInlineQueryChosenChat
    • LoginUrl
    • ForceReply
    • CallbackQuery
    • GameHighScore
    • CallbackGame
    • WebAppInfo
    • MenuButton
    • MenuButtonCommands
    • MenuButtonWebApp
    • MenuButtonDefault
    • SentWebAppMessage
    • BotCommand
    • BotCommandScope
    • BotCommandScopeDefault
    • BotCommandScopeAllPrivateChats
    • BotCommandScopeAllGroupChats
    • BotCommandScopeAllChatAdministrators
    • BotCommandScopeChat
    • BotCommandScopeChatAdministrators
    • BotCommandScopeChatMember
    • BotAccessSettings
    • ChatBoostUpdated
    • ChatShared
    • KeyboardButtonPollType
    • KeyboardButtonRequestChat
    • KeyboardButtonRequestManagedBot
    • KeyboardButtonRequestUsers
    • LabeledPrice
    • ManagedBotUpdated
    • MessageReactionCountUpdated
    • MessageReactionUpdated
    • OrderInfo
    • PreCheckoutQuery
    • PurchasedPaidMedia
    • SentGuestMessage
    • ShippingAddress
    • ShippingOption
    • ShippingQuery
    • UsersShared
    • InlineQuery
    • InlineQueryResult
    • InlineQueryResultCachedAudio
    • InlineQueryResultCachedDocument
    • InlineQueryResultCachedAnimation
    • InlineQueryResultCachedPhoto
    • InlineQueryResultCachedSticker
    • InlineQueryResultCachedVideo
    • InlineQueryResultCachedVoice
    • InlineQueryResultArticle
    • InlineQueryResultAudio
    • InlineQueryResultContact
    • InlineQueryResultDocument
    • InlineQueryResultAnimation
    • InlineQueryResultLocation
    • InlineQueryResultPhoto
    • InlineQueryResultVenue
    • InlineQueryResultVideo
    • InlineQueryResultVoice
    • ChosenInlineResult
    • InputMedia
    • InputMediaPhoto
    • InputMediaVideo
    • InputMediaAudio
    • InputMediaAnimation
    • InputMediaDocument
    • InputPhoneContact
    • InputChatPhoto
    • InputChecklist
    • InputCredentials
    • InputCredentialsApplePay
    • InputCredentialsGooglePay
    • InputCredentialsNew
    • InputCredentialsSaved
    • InputInvoice
    • InputInvoiceMessage
    • InputInvoiceMessageContent
    • InputInvoiceName
    • InputMediaLink
    • InputMediaLivePhoto
    • InputMediaLocation
    • InputMediaSticker
    • InputMediaVenue
    • InputMessageContent
    • InputPollMedia
    • InputPollOption
    • InputPollOptionMedia
    • InputPrivacyRule
    • InputPrivacyRuleAllowAll
    • InputPrivacyRuleAllowBots
    • InputPrivacyRuleAllowChats
    • InputPrivacyRuleAllowCloseFriends
    • InputPrivacyRuleAllowContacts
    • InputPrivacyRuleAllowPremium
    • InputPrivacyRuleAllowUsers
    • InputPrivacyRuleDisallowAll
    • InputPrivacyRuleDisallowBots
    • InputPrivacyRuleDisallowChats
    • InputPrivacyRuleDisallowContacts
    • InputPrivacyRuleDisallowUsers
    • InputRichMessage
    • InputRichMessageContent
    • InputTextMessageContent
    • InputContactMessageContent
    • InputLocationMessageContent
    • InputVenueMessageContent
    • InputChatPhotoAnimation
    • InputChatPhotoPrevious
    • InputChatPhotoStatic
    • InputMediaVoiceNote
    • InputRichBlock
    • InputRichBlockAnchor
    • InputRichBlockAnimation
    • InputRichBlockAudio
    • InputRichBlockBlockQuotation
    • InputRichBlockCollage
    • InputRichBlockDetails
    • InputRichBlockDivider
    • InputRichBlockFooter
    • InputRichBlockList
    • InputRichBlockListItem
    • InputRichBlockMap
    • InputRichBlockMathematicalExpression
    • InputRichBlockParagraph
    • InputRichBlockPhoto
    • InputRichBlockPreformatted
    • InputRichBlockPullQuotation
    • InputRichBlockSectionHeading
    • InputRichBlockSlideshow
    • InputRichBlockTable
    • InputRichBlockTableCell
    • InputRichBlockThinking
    • InputRichBlockVideo
    • InputRichBlockVoiceNote
    • InputRichMessageMedia
    • Identifier
    • Listener
    • SentCode
    • TermsOfService
    • ActiveSession
    • ActiveSessions
    • FirebaseAuthenticationSettings
    • PhoneNumberAuthenticationSettings
    • List
    • FirebaseAuthenticationSettingsAndroid
    • FirebaseAuthenticationSettingsIos
  • Enums
    • BlockList
    • BusinessSchedule
    • ButtonStyle
    • ChatAction
    • ChatEventAction
    • ChatJoinRequestQueryResult
    • ListenerTypes
    • ChatJoinType
    • ChatMemberStatus
    • ChatMembersFilter
    • ChatType
    • ClientPlatform
    • FolderColor
    • GiftAttributeType
    • GiftForResaleOrder
    • GiftPurchaseOfferState
    • GiftType
    • MaskPointType
    • MediaAreaType
    • MessageEntityType
    • MessageMediaType
    • MessageOriginType
    • MessageServiceType
    • MessagesFilter
    • NextCodeType
    • PaidReactionPrivacy
    • ParseMode
    • PaymentFormType
    • PhoneCallDiscardReason
    • PhoneNumberCodeType
    • PollType
    • PrivacyKey
    • PrivacyRuleType
    • ProfileColor
    • ProfileTab
    • ReplyColor
    • SentCodeType
    • StickerType
    • StoriesPrivacyRules
    • SuggestedPostRefundReason
    • SuggestedPostState
    • TopChatCategory
    • UpgradedGiftOrigin
    • UserStatus
  • Bound Methods
    • click
    • delete
    • download
    • forward
    • copy
    • copy_media_group
    • pin
    • unpin
    • edit
    • edit_text
    • edit_caption
    • edit_media
    • edit_reply_markup
    • reply
    • reply_text
    • reply_animation
    • reply_audio
    • reply_cached_media
    • reply_chat_action
    • reply_checklist
    • reply_contact
    • reply_dice
    • reply_document
    • reply_game
    • reply_inline_bot_result
    • reply_invoice
    • reply_location
    • reply_media_group
    • reply_paid_media
    • reply_photo
    • reply_poll
    • reply_sticker
    • reply_venue
    • reply_video
    • reply_video_note
    • reply_voice
    • answer
    • answer_animation
    • answer_audio
    • answer_cached_media
    • answer_checklist
    • answer_contact
    • answer_dice
    • answer_document
    • answer_game
    • answer_inline_bot_result
    • answer_invoice
    • answer_location
    • answer_media_group
    • answer_paid_media
    • answer_photo
    • answer_poll
    • answer_sticker
    • answer_venue
    • answer_video
    • answer_video_note
    • answer_voice
    • get_media_group
    • react
    • wait_for_click
    • read
    • view
    • vote
    • pay
    • retract_vote
    • edit_checklist
    • edit_live_location
    • stop_live_location
    • summarize
    • content
    • link
    • html_text
    • md_text
    • forward_date
    • forward_from
    • forward_from_chat
    • forward_from_message_id
    • forward_sender_name
    • forward_signature
    • is_topic_message
    • archive
    • ask
    • listen
    • stop_listening
    • unarchive
    • set_title
    • set_description
    • set_photo
    • ban_member
    • unban_member
    • restrict_member
    • promote_member
    • get_member
    • get_members
    • add_members
    • join
    • leave
    • mark_unread
    • set_protected_content
    • unpin_all_messages
    • mute
    • unmute
    • set_ttl
    • export_invite_link
    • full_name
    • is_fake
    • is_scam
    • is_verified
    • archive
    • unarchive
    • block
    • unblock
    • full_name
    • is_fake
    • is_scam
    • is_verified
    • mention
    • get_common_chats
    • answer
    • edit_message_text
    • edit_message_caption
    • edit_message_media
    • edit_message_reply_markup
    • answer
    • approve
    • decline
    • copy
    • delete
    • download
    • edit_caption
    • edit_media
    • edit_privacy
    • forward
    • link
    • react
    • read
    • view
    • reply_text
    • reply_animation
    • reply_audio
    • reply_cached_media
    • reply_media_group
    • reply_photo
    • reply_sticker
    • reply_video
    • reply_video_note
    • reply_voice
    • buy
    • send
    • transfer
    • upgrade
    • convert
    • hide
    • show
    • link
    • wear
    • owned_gift_id
    • send_purchase_offer
    • get_auction_state
    • get_vote_percentage
    • answer
    • answer
    • create_invite_link
    • delete
    • edit
    • exclude_chat
    • include_chat
    • pin_chat
    • remove_chat
    • update_color
  • Update Handlers
  • Filters
  • Storage Engines
  • Errors

Concepts

  • MTProto vs. Bot API
  • Message identifiers
  • Text Formatting
  • Object Serialization

Updates & Filters

  • Using Filters
  • Creating Filters
  • More on Updates
  • Smart Plugins

Configuration

  • Client Settings
  • Storage Engines
  • Proxy Settings
  • Scheduling Tasks
  • Test Servers
  • Synchronous Usage

Advanced

  • Advanced Usage
  • Speedups
  • Voice Calls
  • Debugging

Help

  • FAQ
Back to top
View this page

create_invoice_link()¶

async Client.create_invoice_link()¶

Create invoice link.

Usable by Users Bots
Parameters:
  • title (str) – Product name, 1-32 characters.

  • description (str) – Product description, 1-255 characters

  • payload (str | bytes) – Bot-defined invoice payload, 1-128 bytes. This will not be displayed to the user, use for your internal processes.

  • currency (str) – Three-letter ISO 4217 currency code, see more on currencies. Pass XTR for payments in Telegram Stars.

  • prices (List of LabeledPrice) – Price breakdown, a JSON-serialized list of components (e.g. product price, tax, discount, delivery cost, delivery tax, bonus, etc.). Must contain exactly one item for payments in Telegram Stars.

  • provider_token (str, optional) – Payment provider token, obtained via @BotFather. Pass an empty string for payments in Telegram Stars.

  • subscription_period (int, optional) – The number of seconds the subscription will be active for before the next payment. The currency must be set to “XTR” (Telegram Stars) if the parameter is used. Currently, it must always be 2592000 (30 days) if specified.

  • max_tip_amount (int, optional) – The maximum accepted amount for tips in the smallest units of the currency (integer, not float/double). For example, for a maximum tip of US$ 1.45 pass max_tip_amount = 145. See the exp parameter in currencies.json, it shows the number of digits past the decimal point for each currency (2 for the majority of currencies). Defaults to 0. Not supported for payments in Telegram Stars.

  • suggested_tip_amounts (List of int, optional) – An array of suggested amounts of tips in the smallest units of the currency (integer, not float/double). At most 4 suggested tip amounts can be specified. The suggested tip amounts must be positive, passed in a strictly increased order and must not exceed max_tip_amount.

  • start_parameter (str, optional) – Unique deep-linking parameter. If left empty, forwarded copies of the sent message will have a Pay button, allowing multiple users to pay directly from the forwarded message, using the same invoice. If non-empty, forwarded copies of the sent message will have a URL button with a deep link to the bot (instead of a Pay button), with the value used as the start parameter.

  • provider_data (str, optional) – JSON-serialized data about the invoice, which will be shared with the payment provider. A detailed description of required fields should be provided by the payment provider.

  • photo_url (str, optional) – URL of the product photo for the invoice. Can be a photo of the goods or a marketing image for a service. People like it better when they see what they are paying for.

  • photo_size (int, optional) – Photo size in bytes

  • photo_width (int, optional) – Photo width

  • photo_height (int, optional) – Photo height

  • need_name (bool, optional) – Pass True if you require the user’s full name to complete the order. Ignored for payments in Telegram Stars.

  • need_phone_number (bool, optional) – Pass True if you require the user’s phone number to complete the order. Ignored for payments in Telegram Stars.

  • need_email (bool, optional) – Pass True if you require the user’s email address to complete the order. Ignored for payments in Telegram Stars.

  • need_shipping_address (bool, optional) – Pass True if you require the user’s shipping address to complete the order. Ignored for payments in Telegram Stars.

  • send_phone_number_to_provider (bool, optional) – Pass True if the user’s phone number should be sent to the provider. Ignored for payments in Telegram Stars.

  • send_email_to_provider (bool, optional) – Pass True if the user’s email address should be sent to the provider. Ignored for payments in Telegram Stars.

  • is_flexible (bool, optional) – Pass True if the final price depends on the shipping method. Ignored for payments in Telegram Stars.

  • business_connection_id (str, optional) – Unique identifier of the business connection on behalf of which the link is created.

Returns:

str – On success, the invoice url is returned.

Next
delete_bot_commands()
Previous
create_bot()
Copyright © 2017-present Dan, rjriajul
Made with Sphinx and @pradyunsg's Furo
On this page
  • create_invoice_link()
    • Client.create_invoice_link()