sdkagent

python-telegram-bot API reference

173 public APIs from python-telegram-bot (python-telegram-bot/python-telegram-bot) — 133 classes, 8 functions, 32 methods. Signatures extracted by static analysis of the actual source.

Repository: python-telegram-bot/python-telegram-bot

KindCount
Classes133
Functions8
Methods32

API list

classchanges.config.ChangoSectionChangeNote
Custom change note type for PTB.
classchanges.config.CustomChango
Custom ChanGo class for overriding release
classsrc.telegram._birthdate.Birthdate
This object describes the birthdate of a user.
methodsrc.telegram._birthdate.Birthdate.to_date(year:int | None=None) -> dtm.date
Return the birthdate as a date object.
classsrc.telegram._botcommand.BotCommand
This object represents a bot command.
classsrc.telegram._botcommandscope.BotCommandScopeDefault
Represents the default scope of bot commands.
classsrc.telegram._botdescription.BotDescription
This object represents the bot's description.
classsrc.telegram._botname.BotName
This object represents the bot's name.
classsrc.telegram._chat.Chat
This object represents a chat.
classsrc.telegram._chatbackground.BackgroundFill
Base class for Telegram BackgroundFill Objects.
classsrc.telegram._chatbackground.BackgroundFillGradient
The background is a gradient fill.
classsrc.telegram._chatbackground.BackgroundType
Base class for Telegram BackgroundType Objects.
classsrc.telegram._chatbackground.ChatBackground
This object represents a chat background.
classsrc.telegram._chatboost.ChatBoost
This object contains information about a chat boost.
classsrc.telegram._chatboost.ChatBoostSource
Base class for Telegram ChatBoostSource objects.
classsrc.telegram._chatfullinfo.ChatFullInfo
This object contains full information about a chat.
classsrc.telegram._chatinvitelink.ChatInviteLink
This object represents an invite link for a chat.
classsrc.telegram._chatmember.ChatMember
Base class for Telegram ChatMember Objects.
classsrc.telegram._checklists.Checklist
Describes a checklist.
classsrc.telegram._checklists.ChecklistTask
Describes a task in a checklist.
classsrc.telegram._files.chatphoto.ChatPhoto
This object represents a chat photo.
classsrc.telegram._files.contact.Contact
This object represents a phone contact.
classsrc.telegram._files.file.File
This object represents a file ready to be downloaded.
methodsrc.telegram._files.file.File.set_credentials(credentials:'FileCredentials') -> None
Sets the passport credentials for the file.
classsrc.telegram._files.inputfile.InputFile
This object represents a Telegram InputFile.
classsrc.telegram._files.inputmedia.InputMediaDocument
Represents a general file to be sent.
classsrc.telegram._files.inputmedia.InputMediaLivePhoto
Represents a live photo to be sent.
classsrc.telegram._files.inputmedia.InputMediaLocation
Represents a location to be sent.
classsrc.telegram._files.inputmedia.InputMediaPhoto
Represents a photo to be sent.
classsrc.telegram._files.inputmedia.InputMediaSticker
Represents a sticker file to be sent.
classsrc.telegram._files.inputmedia.InputMediaVenue
Represents a venue to be sent.
classsrc.telegram._files.inputmedia.InputMediaVideo
Represents a video to be sent.
classsrc.telegram._files.inputmedia.InputPaidMedia
Base class for Telegram InputPaidMedia Objects.
classsrc.telegram._files.inputmedia.InputPaidMediaLivePhoto
The paid media to send is a live photo.
classsrc.telegram._files.inputmedia.InputPaidMediaPhoto
The paid media to send is a photo.
classsrc.telegram._files.inputmedia.InputPaidMediaVideo
The paid media to send is a video.
classsrc.telegram._files.inputprofilephoto.InputProfilePhoto
This object describes a profile photo to set.
classsrc.telegram._files.inputprofilephoto.InputProfilePhotoStatic
A static profile photo in the .JPG format.
classsrc.telegram._files.inputstorycontent.InputStoryContentPhoto
Describes a photo to post as a story.
classsrc.telegram._files.inputstorycontent.InputStoryContentVideo
Describes a video to post as a story.
classsrc.telegram._files.livephoto.LivePhoto
This object represents a live photo.
classsrc.telegram._files.location.Location
This object represents a point on the map.
classsrc.telegram._files.sticker.Sticker
This object represents a sticker.
classsrc.telegram._files.sticker.StickerSet
This object represents a sticker set.
classsrc.telegram._files.venue.Venue
This object represents a venue.
classsrc.telegram._files.video.Video
This object represents a video file.
classsrc.telegram._files.voice.Voice
This object represents a voice note.
classsrc.telegram._forumtopic.ForumTopic
This object represents a forum topic.
classsrc.telegram._games.callbackgame.CallbackGame
A placeholder, currently holds no information.
classsrc.telegram._games.game.Game
This object represents a game.
classsrc.telegram._gifts.GiftBackground
This object describes the background of a gift.
classsrc.telegram._gifts.Gifts
This object represent a list of gifts.
classsrc.telegram._inline.inlinequery.InlineQuery
This object represents an incoming inline query.
classsrc.telegram._inline.inlinequeryresult.InlineQueryResult
Baseclass for the InlineQueryResult* classes.
classsrc.telegram._inline.inlinequeryresultaudio.InlineQueryResultAudio
Represents a link to an mp3 audio file.
classsrc.telegram._inline.inlinequeryresultdocument.InlineQueryResultDocument
Represents a link to a file.
classsrc.telegram._inline.inlinequeryresultgame.InlineQueryResultGame
Represents a :class:`telegram.Game`.
classsrc.telegram._inline.inlinequeryresultgif.InlineQueryResultGif
Represents a link to an animated GIF file.
classsrc.telegram._inline.inlinequeryresultlocation.InlineQueryResultLocation
Represents a location on a map.
classsrc.telegram._inline.inlinequeryresultphoto.InlineQueryResultPhoto
Represents a link to a photo.
classsrc.telegram._inline.inlinequeryresultvenue.InlineQueryResultVenue
Represents a venue.
classsrc.telegram._inputchecklist.InputChecklist
Describes a checklist to create.
classsrc.telegram._inputchecklist.InputChecklistTask
Describes a task to add to a checklist.
classsrc.telegram._message.InaccessibleMessage
This object represents an inaccessible message.
classsrc.telegram._message.MaybeInaccessibleMessage
Base class for Telegram Message Objects.
methodsrc.telegram._message.MaybeInaccessibleMessage.de_json(data:JSONDict, bot:'Bot | None'=None) -> 'MaybeInaccessibleMessage'
See :meth:`telegram.TelegramObject.de_json`.
methodsrc.telegram._message.MaybeInaccessibleMessage.is_accessible() -> bool
Convenience attribute.
methodsrc.telegram._message.Message.id() -> int
:obj:`int`: Shortcut for :attr:`message_id`.
methodsrc.telegram._message.Message.link() -> str | None
:obj:`str`: Convenience property.
classsrc.telegram._messageid.MessageId
This object represents a unique message identifier.
classsrc.telegram._messageorigin.MessageOriginUser
The message was originally sent by a known user.
classsrc.telegram._paidmedia.PaidMedia
Describes the paid media added to a message.
classsrc.telegram._paidmedia.PaidMediaInfo
Describes the paid media added to a message.
classsrc.telegram._paidmedia.PaidMediaLivePhoto
The paid media is a live photo.
classsrc.telegram._paidmedia.PaidMediaPhoto
The paid media is a photo.
classsrc.telegram._paidmedia.PaidMediaPreview
The paid media isn't available before the payment.
classsrc.telegram._paidmedia.PaidMediaVideo
The paid media is a video.
classsrc.telegram._passport.data.PersonalDetails
This object represents personal details.
classsrc.telegram._passport.data.ResidentialAddress
This object represents a residential address.
classsrc.telegram._payment.orderinfo.OrderInfo
This object represents information about an order.
classsrc.telegram._payment.shippingoption.ShippingOption
This object represents one shipping option.
classsrc.telegram._payment.stars.revenuewithdrawalstate.RevenueWithdrawalStatePending
The withdrawal is in progress.
classsrc.telegram._payment.stars.revenuewithdrawalstate.RevenueWithdrawalStateSucceeded
The withdrawal succeeded.
classsrc.telegram._payment.stars.staramount.StarAmount
Describes an amount of Telegram Stars.
classsrc.telegram._payment.stars.startransactions.StarTransaction
Describes a Telegram Star transaction.
classsrc.telegram._payment.stars.transactionpartner.TransactionPartnerChat
Describes a transaction with a chat.
classsrc.telegram._payment.stars.transactionpartner.TransactionPartnerUser
Describes a transaction with a user.
classsrc.telegram._poll.Poll
This object contains information about a poll.
classsrc.telegram._reaction.ReactionType
Base class for Telegram ReactionType Objects.
classsrc.telegram._reaction.ReactionTypeCustomEmoji
Represents a reaction with a custom emoji.
classsrc.telegram._reaction.ReactionTypeEmoji
Represents a reaction with a normal emoji.
classsrc.telegram._reaction.ReactionTypePaid
The reaction is paid.
classsrc.telegram._sentguestmessage.SentGuestMessage
Describes an inline message sent by a guest bot.
classsrc.telegram._story.Story
This object represents a story.
classsrc.telegram._storyarea.LocationAddress
Describes the physical address of a location.
classsrc.telegram._storyarea.StoryArea
Describes a clickable area on a story media.
classsrc.telegram._storyarea.StoryAreaType
Describes the type of a clickable area on a story.
classsrc.telegram._storyarea.StoryAreaTypeLocation
Describes a story area pointing to a location.
classsrc.telegram._suggestedpost.SuggestedPostInfo
Contains information about a suggested post.
classsrc.telegram._suggestedpost.SuggestedPostPrice
Desribes the price of a suggested post.
classsrc.telegram._telegramobject.TelegramObject
Base class for most Telegram objects.
methodsrc.telegram._telegramobject.TelegramObject.de_json(data:JSONDict, bot:'Bot | None'=None) -> Tele_co
Converts JSON data to a Telegram object.
methodsrc.telegram._telegramobject.TelegramObject.set_bot(bot:'Bot | None') -> None
Sets the :class:`telegram.Bot` instance associated with this object.
methodsrc.telegram._telegramobject.TelegramObject.to_dict(recursive:bool=True) -> JSONDict
Gives representation of object as :obj:`dict`.
methodsrc.telegram._telegramobject.TelegramObject.to_json() -> str
Gives a JSON representation of object.
classsrc.telegram._uniquegift.UniqueGiftModel
This object describes the model of a unique gift.
classsrc.telegram._update.Update
This object represents an incoming update.
classsrc.telegram._user.User
This object represents a Telegram user or bot.
methodsrc.telegram._user.User.full_name() -> str
:obj:`str`: Convenience property.
methodsrc.telegram._user.User.link() -> str | None
:obj:`str`: Convenience property.
methodsrc.telegram._user.User.name() -> str
:obj:`str`: Convenience property.
funcsrc.telegram._utils.datetime.extract_tzinfo_from_defaults(bot:'Bot | None') -> dtm.tzinfo | None
Extracts the timezone info from the default values of the bot.
funcsrc.telegram._utils.de_json.unwrap_optional(annotation:object) -> object
Return the sole non-None member of an optional union, if it has one.
funcsrc.telegram._utils.files.guess_file_name(obj:FileInput) -> str | None
If the input is a file handle, read name and return it.
funcsrc.telegram._utils.files.is_local_file(obj:FilePathInput | None) -> bool
Checks if a given string is a file on local system.
funcsrc.telegram._utils.logging.get_logger(file_name:str, class_name:str | None=None) -> logging.Logger
Returns a logger with an appropriate name.
classsrc.telegram._utils.strings.TextEncoding
This enum contains encoding schemes for text.
funcsrc.telegram._utils.strings.to_camel_case(snake_str:str) -> str
Converts a snake_case string to camelCase.
classsrc.telegram._webhookinfo.WebhookInfo
This object represents a Telegram WebhookInfo.
classsrc.telegram.constants.ChatID
This enum contains some special chat IDs.
classsrc.telegram.constants.ParseMode
This enum contains the available parse modes.
classsrc.telegram.error.EndPointNotFound
Raised when the requested endpoint is not found.
classsrc.telegram.error.InvalidToken
Raised when the token is invalid.
classsrc.telegram.error.NetworkError
Base class for exceptions due to networking errors.
classsrc.telegram.error.PassportDecryptionError
Something went wrong with decryption.
classsrc.telegram.error.RetryAfter
Raised when flood limits where exceeded.
classsrc.telegram.error.TelegramError
Base class for Telegram errors.
classsrc.telegram.error.TimedOut
Raised when a request took too long to finish.
methodsrc.telegram.ext._application.Application.add_handler(handler:BaseHandler[Any, CCT, Any], group:int=DEFAULT_GROUP) -> None
Register a handler.
methodsrc.telegram.ext._application.Application.builder() -> 'InitApplicationBuilder'
Convenience method.
methodsrc.telegram.ext._application.Application.remove_error_handler(callback:HandlerCallback[object, CCT, None]) -> None
Removes an error handler.
methodsrc.telegram.ext._application.Application.remove_handler(handler:BaseHandler[Any, CCT, Any], group:int=DEFAULT_GROUP) -> None
Remove a handler from the specified group.
methodsrc.telegram.ext._baseratelimiter.BaseRateLimiter.initialize() -> None
Initialize resources used by this class.
methodsrc.telegram.ext._baseratelimiter.BaseRateLimiter.shutdown() -> None
Stop & clear resources used by this class.
methodsrc.telegram.ext._callbackcontext.CallbackContext.bot_data() -> BD
:obj:`ContextTypes.bot_data`: Optional.
methodsrc.telegram.ext._callbackcontext.CallbackContext.chat_data() -> CD | None
:obj:`ContextTypes.chat_data`: Optional.
methodsrc.telegram.ext._callbackcontext.CallbackContext.update(data:dict[str, object]) -> None
Updates ``self.__slots__`` with the passed data.
methodsrc.telegram.ext._callbackcontext.CallbackContext.user_data() -> UD | None
:obj:`ContextTypes.user_data`: Optional.
classsrc.telegram.ext._handlers.basehandler.BaseHandler
The base class for all update handlers.
classsrc.telegram.ext._handlers.commandhandler.CommandHandler
Handler class to handle Telegram commands.
classsrc.telegram.ext._handlers.messagehandler.MessageHandler
Handler class to handle Telegram messages.
classsrc.telegram.ext._handlers.stringcommandhandler.StringCommandHandler
Handler class to handle string commands.
methodsrc.telegram.ext._jobqueue.Job.enabled() -> bool
:obj:`bool`: Whether this job is enabled.
classsrc.telegram.ext._utils.webhookhandler.WebhookAppClass
Application used in the Webserver
classsrc.telegram.ext.filters.BaseFilter
Base class for all Filters.
methodsrc.telegram.ext.filters.BaseFilter.name() -> str
:obj:`str`: Name for this filter.
classsrc.telegram.ext.filters.Caption
Messages with a caption.
methodsrc.telegram.ext.filters.Chat.add_chat_ids(chat_id:SCT[int]) -> None
Add one or more chats to the allowed chat ids.
methodsrc.telegram.ext.filters.Chat.remove_chat_ids(chat_id:SCT[int]) -> None
Remove one or more chats from allowed chat ids.
classsrc.telegram.ext.filters.ChatType
Subset for filtering the type of chat.
classsrc.telegram.ext.filters.Dice
Dice Messages.
classsrc.telegram.ext.filters.Dice.Basketball
Dice messages with the emoji 🏀.
classsrc.telegram.ext.filters.Dice.Bowling
Dice messages with the emoji 🎳.
classsrc.telegram.ext.filters.Dice.Darts
Dice messages with the emoji 🎯.
classsrc.telegram.ext.filters.Dice.Dice
Dice messages with the emoji 🎲.
classsrc.telegram.ext.filters.Dice.Football
Dice messages with the emoji ⚽.
classsrc.telegram.ext.filters.Dice.SlotMachine
Dice messages with the emoji 🎰.
classsrc.telegram.ext.filters.Document
Subset for messages containing a document/file.
classsrc.telegram.ext.filters.MessageFilter
Base class for all Message Filters.
methodsrc.telegram.ext.filters.MessageFilter.filter(message:Message) -> bool | FilterDataDict | None
This method must be overwritten.
classsrc.telegram.ext.filters.StatusUpdate
Subset for messages containing a status update.
classsrc.telegram.ext.filters.Sticker
Filters messages which contain a sticker.
classsrc.telegram.ext.filters.SuccessfulPayment
Successful Payment Messages.
classsrc.telegram.ext.filters.Text
Text Messages.
classsrc.telegram.ext.filters.UpdateFilter
Base class for all Update Filters.
methodsrc.telegram.ext.filters.UpdateFilter.filter(update:Update) -> bool | FilterDataDict | None
This method must be overwritten.
classsrc.telegram.ext.filters.UpdateType
Subset for filtering the type of update.
methodsrc.telegram.ext.filters.User.add_user_ids(user_id:SCT[int]) -> None
Add one or more users to the allowed user ids.
methodsrc.telegram.ext.filters.User.remove_user_ids(user_id:SCT[int]) -> None
Remove one or more users from allowed user ids.
methodsrc.telegram.ext.filters.User.user_ids() -> frozenset[int]
Which user ID(s) to allow through.
funcsrc.telegram.helpers.escape_markdown(text:str, version:MarkdownVersion=1, entity_type:str | None=None) -> str
Helper function to escape telegram markup symbols.
funcsrc.telegram.helpers.mention_html(user_id:int | str, name:str) -> str
Helper function to create a user mention as HTML tag.
classsrc.telegram.warnings.PTBDeprecationWarning
Custom warning class for deprecations in this library.

About this data

These signatures were extracted from the public source of python-telegram-bot/python-telegram-bot using Python's ast module. Argument names, default values, type annotations and return types are taken verbatim from the code. Implementation bodies are never stored. See how it works for details.

Back to all 805 libraries