Hide navigation sidebar
Hide table of contents sidebar
PTB has undergone significant changes in v20. Please read the documentation carefully and also check out the transition guide in the wiki.
Back to top
Toggle table of contents sidebar

# telegram.constants Module

This module contains several constants that are relevant for working with the Bot API.

Unless noted otherwise, all constants in this module were extracted from the Telegram Bots FAQ and Telegram Bots API.

Most of the following constants are related to specific classes or topics and are grouped into enums. If they are related to a specific class, then they are also available as attributes of those classes.

Changed in version 20.0:

- Most of the constants in this module are grouped into enums.

class telegram.constants.AccentColor(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `Enum`

  This enum contains the available accent colors for `telegram.Chat.accent_color_id`. The members of this enum are named tuples with the following attributes:

  - `identifier` (`int`): The identifier of the accent color.

  - `name` (`str`): Optional. The name of the accent color.

  - `light_colors` (Tuple[`str`]): Optional. The light colors of the accent color as HEX value.

  - `dark_colors` (Tuple[`str`]): Optional. The dark colors of the accent color as HEX value.

  Since Telegram gives no exact specification for the accent colors, future accent colors might have a different data type.

  New in version 20.8.

  COLOR_000 = (0, 'red', (), ())

    Accent color 0. This color can be customized by app themes.

  COLOR_001 = (1, 'orange', (), ())

    Accent color 1. This color can be customized by app themes.

  COLOR_002 = (2, 'purple/violet', (), ())

    Accent color 2. This color can be customized by app themes.

  COLOR_003 = (3, 'green', (), ())

    Accent color 3. This color can be customized by app themes.

  COLOR_004 = (4, 'cyan', (), ())

    Accent color 4. This color can be customized by app themes.

  COLOR_005 = (5, 'blue', (), ())

    Accent color 5. This color can be customized by app themes.

  COLOR_006 = (6, 'pink', (), ())

    Accent color 6. This color can be customized by app themes.

  COLOR_007 = (7, None, (14766162, 16363107), (16749440, 10039095))

    Accent color 7. This contains two light colors

    and two dark colors

  COLOR_008 = (8, None, (14712875, 16434484), (15511630, 12801812))

    Accent color 8. This contains two light colors

    and two dark colors

  COLOR_009 = (9, None, (10510323, 16027647), (13015039, 6173128))

    Accent color 9. This contains two light colors

    and two dark colors

  COLOR_010 = (10, None, (2599184, 11000919), (11004782, 1474093))

    Accent color 10. This contains two light colors

    and two dark colors

  COLOR_011 = (11, None, (2600142, 8579286), (4249808, 285823))

    Accent color 11. This contains two light colors

    and two dark colors

  COLOR_012 = (12, None, (3379668, 8246256), (5423103, 742548))

    Accent color 12. This contains two light colors

    and two dark colors

  COLOR_013 = (13, None, (14500721, 16760479), (16746150, 9320046))

    Accent color 13. This contains two light colors

    and two dark colors

  COLOR_014 = (14, None, (2391021, 15747158, 16777215), (4170494, 15024719, 16777215))

    Accent color 14. This contains three light colors

    and three dark colors

  COLOR_015 = (15, None, (14055202, 2007057, 16777215), (16748638, 3319079, 16777215))

    Accent color 15. This contains three light colors

    and three dark colors

  COLOR_016 = (16, None, (1547842, 15223359, 16777215), (6738788, 13976655, 16777215))

    Accent color 16. This contains three light colors

    and three dark colors

  COLOR_017 = (17, None, (2659503, 7324758, 16777215), (2276578, 4039232, 16777215))

    Accent color 17. This contains three light colors

    and three dark colors

  COLOR_018 = (18, None, (826035, 16756117, 16770741), (2276578, 16750456, 16767595))

    Accent color 18. This contains three light colors

    and three dark colors

  COLOR_019 = (19, None, (7821270, 16225808, 16768654), (9933311, 15889181, 16767833))

    Accent color 19. This contains three light colors

    and three dark colors

  COLOR_020 = (20, None, (1410511, 15903517, 16777215), (4040427, 15639837, 16777215))

    Accent color 20. This contains three light colors

    and three dark colors

telegram.constants.BOT_API_VERSION = '7.0'

  Telegram Bot API version supported by this version of python-telegram-bot. Also available as `telegram.__bot_api_version__`.

  New in version 13.4.

  Type:

    `str`

telegram.constants.BOT_API_VERSION_INFO = (7, 0)

  The components can also be accessed by name, so `BOT_API_VERSION_INFO[0]` is equivalent to `BOT_API_VERSION_INFO.major` and so on. Also available as `telegram.__bot_api_version_info__`.

  New in version 20.0.

class telegram.constants.BotCommandLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.BotCommand` and `telegram.Bot.set_my_commands()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_COMMAND = 32

    Maximum value allowed for `command` parameter of `telegram.BotCommand`.

    Type:

      `int`

  MAX_COMMAND_NUMBER = 100

    Maximum number of bot commands passed in a `list` to the `commands` parameter of `telegram.Bot.set_my_commands()`.

    Type:

      `int`

  MAX_DESCRIPTION = 256

    Maximum value allowed for `description` parameter of `telegram.BotCommand`.

    Type:

      `int`

  MIN_COMMAND = 1

    Minimum value allowed for `command` parameter of `telegram.BotCommand`.

    Type:

      `int`

  MIN_DESCRIPTION = 1

    Minimum value allowed for `description` parameter of `telegram.BotCommand`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.BotCommandScopeType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.BotCommandScope`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  ALL_CHAT_ADMINISTRATORS = 'all_chat_administrators'

    The type of `telegram.BotCommandScopeAllChatAdministrators`.

    Type:

      `str`

  ALL_GROUP_CHATS = 'all_group_chats'

    The type of `telegram.BotCommandScopeAllGroupChats`.

    Type:

      `str`

  ALL_PRIVATE_CHATS = 'all_private_chats'

    The type of `telegram.BotCommandScopeAllPrivateChats`.

    Type:

      `str`

  CHAT = 'chat'

    The type of `telegram.BotCommandScopeChat`.

    Type:

      `str`

  CHAT_ADMINISTRATORS = 'chat_administrators'

    The type of `telegram.BotCommandScopeChatAdministrators`.

    Type:

      `str`

  CHAT_MEMBER = 'chat_member'

    The type of `telegram.BotCommandScopeChatMember`.

    Type:

      `str`

  DEFAULT = 'default'

    The type of `telegram.BotCommandScopeDefault`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.BotDescriptionLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for the methods `telegram.Bot.set_my_description()` and `telegram.Bot.set_my_short_description()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.2.

  MAX_DESCRIPTION_LENGTH = 512

    Maximum length for the parameter `description` of `telegram.Bot.set_my_description()`

    Type:

      `int`

  MAX_SHORT_DESCRIPTION_LENGTH = 120

    Maximum length for the parameter `short_description` of `telegram.Bot.set_my_short_description()`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.BotNameLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for the methods `telegram.Bot.set_my_name()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.3.

  MAX_NAME_LENGTH = 64

    Maximum length for the parameter `name` of `telegram.Bot.set_my_name()`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.BulkRequestLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.delete_messages()`, `telegram.Bot.forward_messages()` and `telegram.Bot.copy_messages()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.8.

  MAX_LIMIT = 100

    Maximum number of messages required for bulk actions.

    Type:

      `int`

  MIN_LIMIT = 1

    Minimum number of messages required for bulk actions.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.CallbackQueryLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.CallbackQuery`/ `telegram.Bot.answer_callback_query()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  ANSWER_CALLBACK_QUERY_TEXT_LENGTH = 200

    Maximum number of characters in a `str` passed as the `text` parameter of `telegram.Bot.answer_callback_query()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ChatAction(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available chat actions for `telegram.Bot.send_chat_action()`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  CHOOSE_STICKER = 'choose_sticker'

    Chat action indicating that the bot is selecting a sticker.

    Type:

      `str`

  FIND_LOCATION = 'find_location'

    Chat action indicating that the bot is selecting a location.

    Type:

      `str`

  RECORD_VIDEO = 'record_video'

    Chat action indicating that the bot is recording a video.

    Type:

      `str`

  RECORD_VIDEO_NOTE = 'record_video_note'

    Chat action indicating that the bot is recording a video note.

    Type:

      `str`

  RECORD_VOICE = 'record_voice'

    Chat action indicating that the bot is recording a voice message.

    Type:

      `str`

  TYPING = 'typing'

    A chat indicating the bot is typing.

    Type:

      `str`

  UPLOAD_DOCUMENT = 'upload_document'

    Chat action indicating that the bot is uploading a document.

    Type:

      `str`

  UPLOAD_PHOTO = 'upload_photo'

    Chat action indicating that the bot is uploading a photo.

    Type:

      `str`

  UPLOAD_VIDEO = 'upload_video'

    Chat action indicating that the bot is uploading a video.

    Type:

      `str`

  UPLOAD_VIDEO_NOTE = 'upload_video_note'

    Chat action indicating that the bot is uploading a video note.

    Type:

      `str`

  UPLOAD_VOICE = 'upload_voice'

    Chat action indicating that the bot is uploading a voice message.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ChatBoostSources(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available sources for a `Telegram chat boost`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.8.

  GIFT_CODE = 'gift_code'

    The source of the chat boost was a Telegram Premium gift code.

    Type:

      `str`

  GIVEAWAY = 'giveaway'

    The source of the chat boost was a Telegram Premium giveaway.

    Type:

      `str`

  PREMIUM = 'premium'

    The source of the chat boost was a Telegram Premium subscription/gift.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ChatID(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains some special chat IDs. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  ANONYMOUS_ADMIN = 1087968824

    User ID in groups for messages sent by anonymous admins. Telegram chat: @GroupAnonymousBot.

    Note

    `telegram.Message.from_user` will contain this ID for backwards compatibility only. It’s recommended to use `telegram.Message.sender_chat` instead.

    Type:

      `int`

  FAKE_CHANNEL = 136817688

    User ID in groups when message is sent on behalf of a channel, or when a channel votes on a poll. Telegram chat: @Channel_Bot.

    Note

    - `telegram.Message.from_user` will contain this ID for backwards compatibility only. It’s recommended to use `telegram.Message.sender_chat` instead.

    - `telegram.PollAnswer.user` will contain this ID for backwards compatibility only. It’s recommended to use `telegram.PollAnswer.voter_chat` instead.

    Type:

      `int`

  SERVICE_CHAT = 777000

    Telegram service chat, that also acts as sender of channel posts forwarded to discussion groups. Telegram chat: Telegram.

    Note

    `telegram.Message.from_user` will contain this ID for backwards compatibility only. It’s recommended to use `telegram.Message.sender_chat` instead.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ChatInviteLinkLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.ChatInviteLink`/ `telegram.Bot.create_chat_invite_link()`/`telegram.Bot.edit_chat_invite_link()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_MEMBER_LIMIT = 99999

    Maximum value allowed for the `member_limit` parameter of `telegram.Bot.create_chat_invite_link()` and `member_limit` of `telegram.Bot.edit_chat_invite_link()`.

    Type:

      `int`

  MIN_MEMBER_LIMIT = 1

    Minimum value allowed for the `member_limit` parameter of `telegram.Bot.create_chat_invite_link()` and `member_limit` of `telegram.Bot.edit_chat_invite_link()`.

    Type:

      `int`

  NAME_LENGTH = 32

    Maximum number of characters in a `str` passed as the `name` parameter of `telegram.Bot.create_chat_invite_link()` and `name` of `telegram.Bot.edit_chat_invite_link()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ChatLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.set_chat_administrator_custom_title()`, `telegram.Bot.set_chat_description()`, and `telegram.Bot.set_chat_title()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  CHAT_ADMINISTRATOR_CUSTOM_TITLE_LENGTH = 16

    Maximum length of a `str` passed as the `custom_title` parameter of `telegram.Bot.set_chat_administrator_custom_title()`.

    Type:

      `int`

  CHAT_DESCRIPTION_LENGTH = 255

    Maximum number of characters in a `str` passed as the `description` parameter of `telegram.Bot.set_chat_description()`.

    Type:

      `int`

  MAX_CHAT_TITLE_LENGTH = 128

    Maximum length of a `str` passed as the `title` parameter of `telegram.Bot.set_chat_title()`.

    Type:

      `int`

  MIN_CHAT_TITLE_LENGTH = 1

    Minimum length of a `str` passed as the `title` parameter of `telegram.Bot.set_chat_title()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ChatMemberStatus(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available states for `telegram.ChatMember`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  ADMINISTRATOR = 'administrator'

    A `telegram.ChatMember` who is administrator of the chat.

    Type:

      `str`

  BANNED = 'kicked'

    A `telegram.ChatMember` who was banned in the chat.

    Type:

      `str`

  LEFT = 'left'

    A `telegram.ChatMember` who has left the chat.

    Type:

      `str`

  MEMBER = 'member'

    A `telegram.ChatMember` who is a member of the chat.

    Type:

      `str`

  OWNER = 'creator'

    A `telegram.ChatMember` who is the owner of the chat.

    Type:

      `str`

  RESTRICTED = 'restricted'

    A `telegram.ChatMember` who was restricted in this chat.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ChatPhotoSize(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.ChatPhoto`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  BIG = 640

    Width and height of a big chat photo, ID of which is passed in `big_file_id` and `big_file_unique_id` parameters of `telegram.ChatPhoto`.

    Type:

      `int`

  SMALL = 160

    Width and height of a small chat photo, ID of which is passed in `small_file_id` and `small_file_unique_id` parameters of `telegram.ChatPhoto`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ChatType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.Chat`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  CHANNEL = 'channel'

    A `telegram.Chat` that is a channel.

    Type:

      `str`

  GROUP = 'group'

    A `telegram.Chat` that is a group.

    Type:

      `str`

  PRIVATE = 'private'

    A `telegram.Chat` that is private.

    Type:

      `str`

  SENDER = 'sender'

    A `telegram.Chat` that represents the chat of a `telegram.User` sending an `telegram.InlineQuery`.

    Type:

      `str`

  SUPERGROUP = 'supergroup'

    A `telegram.Chat` that is a supergroup.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ContactLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InlineQueryResultContact`, `telegram.InputContactMessageContent`, and `telegram.Bot.send_contact()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  VCARD = 2048

    Maximum value allowed for:

    - `vcard` parameter of `send_contact()`

    - `vcard` parameter of `InlineQueryResultContact`

    - `vcard` parameter of `InputContactMessageContent`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.CustomEmojiStickerLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.get_custom_emoji_stickers()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  CUSTOM_EMOJI_IDENTIFIER_LIMIT = 200

    Maximum amount of custom emoji identifiers which can be specified for the `custom_emoji_ids` parameter of `telegram.Bot.get_custom_emoji_stickers()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.DiceEmoji(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available emoji for `telegram.Dice`/ `telegram.Bot.send_dice()`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  BASKETBALL = '🏀'

    A `telegram.Dice` with the emoji `🏀`.

    Type:

      `str`

  BOWLING = '🎳'

    A `telegram.Dice` with the emoji `🎳`.

    Type:

      `str`

  DARTS = '🎯'

    A `telegram.Dice` with the emoji `🎯`.

    Type:

      `str`

  DICE = '🎲'

    A `telegram.Dice` with the emoji `🎲`.

    Type:

      `str`

  FOOTBALL = '⚽'

    A `telegram.Dice` with the emoji `⚽`.

    Type:

      `str`

  SLOT_MACHINE = '🎰'

    A `telegram.Dice` with the emoji `🎰`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.DiceLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Dice`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_VALUE_BASKETBALL = 5

    Maximum value allowed for `value` parameter of `telegram.Dice` if `emoji` is `'🏀'`.

    Type:

      `int`

  MAX_VALUE_BOWLING = 6

    Maximum value allowed for `value` parameter of `telegram.Dice` if `emoji` is `'🎳'`.

    Type:

      `int`

  MAX_VALUE_DARTS = 6

    Maximum value allowed for `value` parameter of `telegram.Dice` if `emoji` is `'🎯'`.

    Type:

      `int`

  MAX_VALUE_DICE = 6

    Maximum value allowed for `value` parameter of `telegram.Dice` if `emoji` is `'🎲'`.

    Type:

      `int`

  MAX_VALUE_FOOTBALL = 5

    Maximum value allowed for `value` parameter of `telegram.Dice` if `emoji` is `'⚽'`.

    Type:

      `int`

  MAX_VALUE_SLOT_MACHINE = 64

    Maximum value allowed for `value` parameter of `telegram.Dice` if `emoji` is `'🎰'`.

    Type:

      `int`

  MIN_VALUE = 1

    Minimum value allowed for `value` parameter of `telegram.Dice` (any emoji).

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.FileSizeLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations regarding the upload and download of files. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  FILESIZE_DOWNLOAD = 20000000

    Bots can download files of up to 20MB in size.

    Type:

      `int`

  FILESIZE_DOWNLOAD_LOCAL_MODE = 9223372036854775807

    Bots can download files without a size limit when using a local bot API server.

    Type:

      `int`

  FILESIZE_UPLOAD = 50000000

    Bots can upload non-photo files of up to 50MB in size.

    Type:

      `int`

  FILESIZE_UPLOAD_LOCAL_MODE = 2000000000

    Bots can upload non-photo files of up to 2000MB in size when using a local bot API server.

    Type:

      `int`

  PHOTOSIZE_UPLOAD = 10000000

    Bots can upload photo files of up to 10MB in size.

    Type:

      `int`

  VOICE_NOTE_FILE_SIZE = 1000000

    File size limit for the `send_voice()` method of `telegram.Bot`. Bots can send audio/ogg files of up to 1MB in size as a voice note. Larger voice notes (up to 20MB) will be sent as files.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.FloodLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations regarding flood limits. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MESSAGES_PER_MINUTE_PER_GROUP = 20

    The number of messages that can roughly be sent to a particular group within one minute.

    Type:

      `int`

  MESSAGES_PER_SECOND = 30

    The number of messages that can roughly be sent in an interval of 30 seconds across all chats.

    Type:

      `int`

  MESSAGES_PER_SECOND_PER_CHAT = 1

    The number of messages that can be sent per second in a particular chat. Telegram may allow short bursts that go over this limit, but eventually you’ll begin receiving 429 errors.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ForumIconColor(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains the available colors for use in `telegram.Bot.create_forum_topic.icon_color`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  BLUE = 7322096

    An icon with a color which corresponds to blue (`0x6FB9F0`).

    Type:

      `int`

  GREEN = 9367192

    An icon with a color which corresponds to green (`0x8EEE98`).

    Type:

      `int`

  PINK = 16749490

    An icon with a color which corresponds to pink (`0xFF93B2`).

    Type:

      `int`

  PURPLE = 13338331

    An icon with a color which corresponds to purple (`0xCB86DB`).

    Type:

      `int`

  RED = 16478047

    An icon with a color which corresponds to red (`0xFB6F5F`).

    Type:

      `int`

  YELLOW = 16766590

    An icon with a color which corresponds to yellow (`0xFFD67E`).

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ForumTopicLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.create_forum_topic.name` and `telegram.Bot.edit_forum_topic.name`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_NAME_LENGTH = 128

    Maximum length of a `str` passed as:

    - `name` parameter of `telegram.Bot.create_forum_topic()`

    - `name` parameter of `telegram.Bot.edit_forum_topic()`

    - `name` parameter of `telegram.Bot.edit_general_forum_topic()`

    Type:

      `int`

  MIN_NAME_LENGTH = 1

    Minimum length of a `str` passed as:

    - `name` parameter of `telegram.Bot.create_forum_topic()`

    - `name` parameter of `telegram.Bot.edit_forum_topic()`

    - `name` parameter of `telegram.Bot.edit_general_forum_topic()`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.GiveawayLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Giveaway` and related classes. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.8.

  MAX_WINNERS = 100

    Maximum number of winners allowed for `telegram.GiveawayWinners.winners`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.InlineKeyboardButtonLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InlineKeyboardButton`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_CALLBACK_DATA = 64

    Maximum value allowed for `callback_data` parameter of `telegram.InlineKeyboardButton`

    Type:

      `int`

  MIN_CALLBACK_DATA = 1

    Minimum value allowed for `callback_data` parameter of `telegram.InlineKeyboardButton`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.InlineKeyboardMarkupLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InlineKeyboardMarkup`/ `telegram.Bot.send_message()` & friends. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  BUTTONS_PER_ROW = 8

    Maximum number of buttons that can be attached to a message per row.

    Note

    This value is undocumented and might be changed by Telegram.

    Type:

      `int`

  TOTAL_BUTTON_NUMBER = 100

    Maximum number of buttons that can be attached to a message.

    Note

    This value is undocumented and might be changed by Telegram.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.InlineQueryLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InlineQuery`/ `telegram.Bot.answer_inline_query()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_OFFSET_LENGTH = 64

    Maximum number of bytes in a `str` passed as the `next_offset` parameter of `telegram.Bot.answer_inline_query()`.

    Type:

      `int`

  MAX_QUERY_LENGTH = 256

    Maximum number of characters in a `str` passed as the `query` parameter of `telegram.InlineQuery`.

    Type:

      `int`

  MAX_SWITCH_PM_TEXT_LENGTH = 64

    Maximum number of characters in a `str` passed as the `switch_pm_parameter` parameter of `telegram.Bot.answer_inline_query()`.

    Deprecated since version 20.3: Deprecated in favor of `InlineQueryResultsButtonLimit.MAX_START_PARAMETER_LENGTH`.

    Type:

      `int`

  MIN_SWITCH_PM_TEXT_LENGTH = 1

    Minimum number of characters in a `str` passed as the `switch_pm_parameter` parameter of `telegram.Bot.answer_inline_query()`.

    Deprecated since version 20.3: Deprecated in favor of `InlineQueryResultsButtonLimit.MIN_START_PARAMETER_LENGTH`.

    Type:

      `int`

  RESULTS = 50

    Maximum number of results that can be passed to `telegram.Bot.answer_inline_query()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.InlineQueryResultLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InlineQueryResult` and its subclasses. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_ID_LENGTH = 64

    Maximum number of bytes in a `str` passed as the `id` parameter of `telegram.InlineQueryResult` and its subclasses

    Type:

      `int`

  MIN_ID_LENGTH = 1

    Minimum number of bytes in a `str` passed as the `id` parameter of `telegram.InlineQueryResult` and its subclasses

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.InlineQueryResultType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.InlineQueryResult`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  ARTICLE = 'article'

    Type of `telegram.InlineQueryResultArticle`.

    Type:

      `str`

  AUDIO = 'audio'

    Type of `telegram.InlineQueryResultAudio` and `telegram.InlineQueryResultCachedAudio`.

    Type:

      `str`

  CONTACT = 'contact'

    Type of `telegram.InlineQueryResultContact`.

    Type:

      `str`

  DOCUMENT = 'document'

    Type of `telegram.InlineQueryResultDocument` and `telegram.InlineQueryResultCachedDocument`.

    Type:

      `str`

  GAME = 'game'

    Type of `telegram.InlineQueryResultGame`.

    Type:

      `str`

  GIF = 'gif'

    Type of `telegram.InlineQueryResultGif` and `telegram.InlineQueryResultCachedGif`.

    Type:

      `str`

  LOCATION = 'location'

    Type of `telegram.InlineQueryResultLocation`.

    Type:

      `str`

  MPEG4GIF = 'mpeg4_gif'

    Type of `telegram.InlineQueryResultMpeg4Gif` and `telegram.InlineQueryResultCachedMpeg4Gif`.

    Type:

      `str`

  PHOTO = 'photo'

    Type of `telegram.InlineQueryResultPhoto` and `telegram.InlineQueryResultCachedPhoto`.

    Type:

      `str`

  STICKER = 'sticker'

    Type of and `telegram.InlineQueryResultCachedSticker`.

    Type:

      `str`

  VENUE = 'venue'

    Type of `telegram.InlineQueryResultVenue`.

    Type:

      `str`

  VIDEO = 'video'

    Type of `telegram.InlineQueryResultVideo` and `telegram.InlineQueryResultCachedVideo`.

    Type:

      `str`

  VOICE = 'voice'

    Type of `telegram.InlineQueryResultVoice` and `telegram.InlineQueryResultCachedVoice`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.InlineQueryResultsButtonLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InlineQueryResultsButton`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.3.

  MAX_START_PARAMETER_LENGTH = 64

    Maximum number of characters in a `str` passed as the `start_parameter` parameter of `telegram.InlineQueryResultsButton()`.

    Type:

      `int`

  MIN_START_PARAMETER_LENGTH = 1

    Minimum number of characters in a `str` passed as the `start_parameter` parameter of `telegram.InlineQueryResultsButton()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.InputMediaType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.InputMedia`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  ANIMATION = 'animation'

    Type of `telegram.InputMediaAnimation`.

    Type:

      `str`

  AUDIO = 'audio'

    Type of `telegram.InputMediaAudio`.

    Type:

      `str`

  DOCUMENT = 'document'

    Type of `telegram.InputMediaDocument`.

    Type:

      `str`

  PHOTO = 'photo'

    Type of `telegram.InputMediaPhoto`.

    Type:

      `str`

  VIDEO = 'video'

    Type of `telegram.InputMediaVideo`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.InvoiceLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.InputInvoiceMessageContent`, `telegram.Bot.send_invoice()`, and `telegram.Bot.create_invoice_link()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_DESCRIPTION_LENGTH = 255

    Maximum number of characters in a `str` passed as:

    - `description` parameter of `telegram.InputInvoiceMessageContent`

    - `description` parameter of `telegram.Bot.send_invoice()`.

    - `description` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  MAX_PAYLOAD_LENGTH = 128

    Maximum amount of bytes in a `str` passed as:

    - `payload` parameter of `telegram.InputInvoiceMessageContent`

    - `payload` parameter of `telegram.Bot.send_invoice()`.

    - `payload` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  MAX_TIP_AMOUNTS = 4

    Maximum length of a `Sequence` passed as:

    - `suggested_tip_amounts` parameter of `telegram.Bot.send_invoice()`.

    - `suggested_tip_amounts` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  MAX_TITLE_LENGTH = 32

    Maximum number of characters in a `str` passed as:

    - `title` parameter of `telegram.InputInvoiceMessageContent`

    - `title` parameter of `telegram.Bot.send_invoice()`.

    - `title` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  MIN_DESCRIPTION_LENGTH = 1

    Minimum number of characters in a `str` passed as:

    - `description` parameter of `telegram.InputInvoiceMessageContent`

    - `description` parameter of `telegram.Bot.send_invoice()`.

    - `description` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  MIN_PAYLOAD_LENGTH = 1

    Minimum amount of bytes in a `str` passed as:

    - `payload` parameter of `telegram.InputInvoiceMessageContent`

    - `payload` parameter of `telegram.Bot.send_invoice()`.

    - `payload` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  MIN_TITLE_LENGTH = 1

    Minimum number of characters in a `str` passed as:

    - `title` parameter of `telegram.InputInvoiceMessageContent`

    - `title` parameter of `telegram.Bot.send_invoice()`.

    - `title` parameter of `telegram.Bot.create_invoice_link()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.KeyboardButtonRequestUsersLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.KeyboardButtonRequestUsers`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.8.

  MAX_QUANTITY = 10

    Maximum value allowed for `max_quantity` parameter of `telegram.KeyboardButtonRequestUsers`.

    Type:

      `int`

  MIN_QUANTITY = 1

    Minimum value allowed for `max_quantity` parameter of `telegram.KeyboardButtonRequestUsers`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.LocationLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Location`/`telegram.ChatLocation`/ `telegram.Bot.edit_message_live_location()`/`telegram.Bot.send_location()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  HORIZONTAL_ACCURACY = 1500

    Maximum value allowed for:

    - `horizontal_accuracy` parameter of `telegram.Location`

    - `horizontal_accuracy` parameter of `telegram.InlineQueryResultLocation`

    - `horizontal_accuracy` parameter of `telegram.InputLocationMessageContent`

    - `horizontal_accuracy` parameter of `telegram.Bot.edit_message_live_location()`

    - `horizontal_accuracy` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  MAX_CHAT_LOCATION_ADDRESS = 64

    Minimum value allowed for `address` parameter of `telegram.ChatLocation`

    Type:

      `int`

  MAX_HEADING = 360

    Maximum value allowed for:

    - `heading` parameter of `telegram.Location`

    - `heading` parameter of `telegram.InlineQueryResultLocation`

    - `heading` parameter of `telegram.InputLocationMessageContent`

    - `heading` parameter of `telegram.Bot.edit_message_live_location()`

    - `heading` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  MAX_LIVE_PERIOD = 86400

    Maximum value allowed for:

    - `live_period` parameter of `telegram.InlineQueryResultLocation`

    - `live_period` parameter of `telegram.InputLocationMessageContent`

    - `live_period` parameter of `telegram.Bot.edit_message_live_location()`

    - `live_period` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  MAX_PROXIMITY_ALERT_RADIUS = 100000

    Maximum value allowed for:

    - `proximity_alert_radius` parameter of `telegram.InlineQueryResultLocation`

    - `proximity_alert_radius` parameter of `telegram.InputLocationMessageContent`

    - `proximity_alert_radius` parameter of `telegram.Bot.edit_message_live_location()`

    - `proximity_alert_radius` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  MIN_CHAT_LOCATION_ADDRESS = 1

    Minimum value allowed for `address` parameter of `telegram.ChatLocation`

    Type:

      `int`

  MIN_HEADING = 1

    Minimum value allowed for:

    - `heading` parameter of `telegram.Location`

    - `heading` parameter of `telegram.InlineQueryResultLocation`

    - `heading` parameter of `telegram.InputLocationMessageContent`

    - `heading` parameter of `telegram.Bot.edit_message_live_location()`

    - `heading` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  MIN_LIVE_PERIOD = 60

    Minimum value allowed for:

    - `live_period` parameter of `telegram.InlineQueryResultLocation`

    - `live_period` parameter of `telegram.InputLocationMessageContent`

    - `live_period` parameter of `telegram.Bot.edit_message_live_location()`

    - `live_period` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  MIN_PROXIMITY_ALERT_RADIUS = 1

    Minimum value allowed for:

    - `proximity_alert_radius` parameter of `telegram.InlineQueryResultLocation`

    - `proximity_alert_radius` parameter of `telegram.InputLocationMessageContent`

    - `proximity_alert_radius` parameter of `telegram.Bot.edit_message_live_location()`

    - `proximity_alert_radius` parameter of `telegram.Bot.send_location()`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.MaskPosition(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available positions for `telegram.MaskPosition`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  CHIN = 'chin'

    Mask position for a sticker on the chin.

    Type:

      `str`

  EYES = 'eyes'

    Mask position for a sticker on the eyes.

    Type:

      `str`

  FOREHEAD = 'forehead'

    Mask position for a sticker on the forehead.

    Type:

      `str`

  MOUTH = 'mouth'

    Mask position for a sticker on the mouth.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.MediaGroupLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.send_media_group()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_MEDIA_LENGTH = 10

    Maximum length of a `list` passed as the `media` parameter of `telegram.Bot.send_media_group()`.

    Type:

      `int`

  MIN_MEDIA_LENGTH = 2

    Minimum length of a `list` passed as the `media` parameter of `telegram.Bot.send_media_group()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.MenuButtonType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.MenuButton`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  COMMANDS = 'commands'

    The type of `telegram.MenuButtonCommands`.

    Type:

      `str`

  DEFAULT = 'default'

    The type of `telegram.MenuButtonDefault`.

    Type:

      `str`

  WEB_APP = 'web_app'

    The type of `telegram.MenuButtonWebApp`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.MessageAttachmentType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.Message` that can be seen as attachment. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  ANIMATION = 'animation'

    Messages with `telegram.Message.animation`.

    Type:

      `str`

  AUDIO = 'audio'

    Messages with `telegram.Message.audio`.

    Type:

      `str`

  CONTACT = 'contact'

    Messages with `telegram.Message.contact`.

    Type:

      `str`

  DICE = 'dice'

    Messages with `telegram.Message.dice`.

    Type:

      `str`

  DOCUMENT = 'document'

    Messages with `telegram.Message.document`.

    Type:

      `str`

  GAME = 'game'

    Messages with `telegram.Message.game`.

    Type:

      `str`

  INVOICE = 'invoice'

    Messages with `telegram.Message.invoice`.

    Type:

      `str`

  LOCATION = 'location'

    Messages with `telegram.Message.location`.

    Type:

      `str`

  PASSPORT_DATA = 'passport_data'

    Messages with `telegram.Message.passport_data`.

    Type:

      `str`

  PHOTO = 'photo'

    Messages with `telegram.Message.photo`.

    Type:

      `str`

  POLL = 'poll'

    Messages with `telegram.Message.poll`.

    Type:

      `str`

  STICKER = 'sticker'

    Messages with `telegram.Message.sticker`.

    Type:

      `str`

  STORY = 'story'

    Messages with `telegram.Message.story`.

    Type:

      `str`

  SUCCESSFUL_PAYMENT = 'successful_payment'

    Messages with `telegram.Message.successful_payment`.

    Type:

      `str`

  VENUE = 'venue'

    Messages with `telegram.Message.venue`.

    Type:

      `str`

  VIDEO = 'video'

    Messages with `telegram.Message.video`.

    Type:

      `str`

  VIDEO_NOTE = 'video_note'

    Messages with `telegram.Message.video_note`.

    Type:

      `str`

  VOICE = 'voice'

    Messages with `telegram.Message.voice`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.MessageEntityType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.MessageEntity`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  BLOCKQUOTE = 'blockquote'

    Message entities representing a block quotation.

    New in version 20.8.

    Type:

      `str`

  BOLD = 'bold'

    Message entities representing bold text.

    Type:

      `str`

  BOT_COMMAND = 'bot_command'

    Message entities representing a bot command.

    Type:

      `str`

  CASHTAG = 'cashtag'

    Message entities representing a cashtag.

    Type:

      `str`

  CODE = 'code'

    Message entities representing monowidth string.

    Type:

      `str`

  CUSTOM_EMOJI = 'custom_emoji'

    Message entities representing inline custom emoji stickers.

    New in version 20.0.

    Type:

      `str`

  EMAIL = 'email'

    Message entities representing a email.

    Type:

      `str`

  HASHTAG = 'hashtag'

    Message entities representing a hashtag.

    Type:

      `str`

  ITALIC = 'italic'

    Message entities representing italic text.

    Type:

      `str`

  MENTION = 'mention'

    Message entities representing a mention.

    Type:

      `str`

  PHONE_NUMBER = 'phone_number'

    Message entities representing a phone number.

    Type:

      `str`

  PRE = 'pre'

    Message entities representing monowidth block.

    Type:

      `str`

  SPOILER = 'spoiler'

    Message entities representing spoiler text.

    Type:

      `str`

  STRIKETHROUGH = 'strikethrough'

    Message entities representing strikethrough text.

    Type:

      `str`

  TEXT_LINK = 'text_link'

    Message entities representing clickable text URLs.

    Type:

      `str`

  TEXT_MENTION = 'text_mention'

    Message entities representing text mention for users without usernames.

    Type:

      `str`

  UNDERLINE = 'underline'

    Message entities representing underline text.

    Type:

      `str`

  URL = 'url'

    Message entities representing a url.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.MessageLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Message`/ `telegram.InputTextMessageContent`/ `telegram.Bot.send_message()` & friends. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  CAPTION_LENGTH = 1024

    Maximum number of characters in a `str` passed as:

    - `caption` parameter of `telegram.Message`

    - `caption` parameter of `telegram.InputMedia` and its subclasses

    - `caption` parameter of subclasses of `telegram.InlineQueryResult`

    - `caption` parameter of `telegram.Bot.send_photo()`, `telegram.Bot.send_audio()`, `telegram.Bot.send_document()`, `telegram.Bot.send_video()`, `telegram.Bot.send_animation()`, `telegram.Bot.send_voice()`, `telegram.Bot.edit_message_caption()`, `telegram.Bot.copy_message()`

    Type:

      `int`

  DEEP_LINK_LENGTH = 64

    Maximum number of characters for a deep link.

    Type:

      `int`

  MAX_TEXT_LENGTH = 4096

    Maximum number of characters in a `str` passed as:

    - `text` parameter of `telegram.Game`

    - `text` parameter of `telegram.Message`

    - `message_text` parameter of `telegram.InputTextMessageContent`

    - `text` parameter of `telegram.Bot.send_message()`

    - `text` parameter of `telegram.Bot.edit_message_text()`

    Type:

      `int`

  MESSAGE_ENTITIES = 100

    Maximum number of entities that can be displayed in a message. Further entities will simply be ignored by Telegram.

    Note

    This value is undocumented and might be changed by Telegram.

    Type:

      `int`

  MIN_TEXT_LENGTH = 1

    Minimum number of characters in a `str` passed as the `message_text` parameter of `telegram.InputTextMessageContent` and the `text` parameter of `telegram.Bot.edit_message_text()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.MessageOriginType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.MessageOrigin`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.8.

  CHANNEL = 'channel'

    A `telegram.MessageOrigin` who is sent by a channel.

    Type:

      `str`

  CHAT = 'chat'

    A `telegram.MessageOrigin` who is sent by a chat.

    Type:

      `str`

  HIDDEN_USER = 'hidden_user'

    A `telegram.MessageOrigin` who is sent by a hidden user.

    Type:

      `str`

  USER = 'user'

    A `telegram.MessageOrigin` who is sent by an user.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.MessageType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.Message`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  ANIMATION = 'animation'

    Messages with `telegram.Message.animation`.

    Type:

      `str`

  AUDIO = 'audio'

    Messages with `telegram.Message.audio`.

    Type:

      `str`

  CHANNEL_CHAT_CREATED = 'channel_chat_created'

    Messages with `telegram.Message.channel_chat_created`.

    Type:

      `str`

  CHAT_SHARED = 'chat_shared'

    Messages with `telegram.Message.chat_shared`.

    New in version 20.8.

    Type:

      `str`

  CONNECTED_WEBSITE = 'connected_website'

    Messages with `telegram.Message.connected_website`.

    Type:

      `str`

  CONTACT = 'contact'

    Messages with `telegram.Message.contact`.

    Type:

      `str`

  DELETE_CHAT_PHOTO = 'delete_chat_photo'

    Messages with `telegram.Message.delete_chat_photo`.

    Type:

      `str`

  DICE = 'dice'

    Messages with `telegram.Message.dice`.

    Type:

      `str`

  DOCUMENT = 'document'

    Messages with `telegram.Message.document`.

    Type:

      `str`

  FORUM_TOPIC_CLOSED = 'forum_topic_closed'

    Messages with `telegram.Message.forum_topic_closed`.

    New in version 20.8.

    Type:

      `str`

  FORUM_TOPIC_CREATED = 'forum_topic_created'

    Messages with `telegram.Message.forum_topic_created`.

    New in version 20.8.

    Type:

      `str`

  FORUM_TOPIC_EDITED = 'forum_topic_edited'

    Messages with `telegram.Message.forum_topic_edited`.

    New in version 20.8.

    Type:

      `str`

  FORUM_TOPIC_REOPENED = 'forum_topic_reopened'

    Messages with `telegram.Message.forum_topic_reopened`.

    New in version 20.8.

    Type:

      `str`

  GAME = 'game'

    Messages with `telegram.Message.game`.

    Type:

      `str`

  GENERAL_FORUM_TOPIC_HIDDEN = 'general_forum_topic_hidden'

    Messages with `telegram.Message.general_forum_topic_hidden`.

    New in version 20.8.

    Type:

      `str`

  GENERAL_FORUM_TOPIC_UNHIDDEN = 'general_forum_topic_unhidden'

    Messages with `telegram.Message.general_forum_topic_unhidden`.

    New in version 20.8.

    Type:

      `str`

  GIVEAWAY = 'giveaway'

    Messages with `telegram.Message.giveaway`.

    New in version 20.8.

    Type:

      `str`

  GIVEAWAY_COMPLETED = 'giveaway_completed'

    Messages with `telegram.Message.giveaway_completed`.

    New in version 20.8.

    Type:

      `str`

  GIVEAWAY_CREATED = 'giveaway_created'

    Messages with `telegram.Message.giveaway_created`.

    New in version 20.8.

    Type:

      `str`

  GIVEAWAY_WINNERS = 'giveaway_winners'

    Messages with `telegram.Message.giveaway_winners`.

    New in version 20.8.

    Type:

      `str`

  GROUP_CHAT_CREATED = 'group_chat_created'

    Messages with `telegram.Message.group_chat_created`.

    Type:

      `str`

  INVOICE = 'invoice'

    Messages with `telegram.Message.invoice`.

    Type:

      `str`

  LEFT_CHAT_MEMBER = 'left_chat_member'

    Messages with `telegram.Message.left_chat_member`.

    Type:

      `str`

  LOCATION = 'location'

    Messages with `telegram.Message.location`.

    Type:

      `str`

  MESSAGE_AUTO_DELETE_TIMER_CHANGED = 'message_auto_delete_timer_changed'

    Messages with `telegram.Message.message_auto_delete_timer_changed`.

    Type:

      `str`

  MIGRATE_TO_CHAT_ID = 'migrate_to_chat_id'

    Messages with `telegram.Message.migrate_to_chat_id`.

    Type:

      `str`

  NEW_CHAT_MEMBERS = 'new_chat_members'

    Messages with `telegram.Message.new_chat_members`.

    Type:

      `str`

  NEW_CHAT_PHOTO = 'new_chat_photo'

    Messages with `telegram.Message.new_chat_photo`.

    Type:

      `str`

  NEW_CHAT_TITLE = 'new_chat_title'

    Messages with `telegram.Message.new_chat_title`.

    Type:

      `str`

  PASSPORT_DATA = 'passport_data'

    Messages with `telegram.Message.passport_data`.

    Type:

      `str`

  PHOTO = 'photo'

    Messages with `telegram.Message.photo`.

    Type:

      `str`

  PINNED_MESSAGE = 'pinned_message'

    Messages with `telegram.Message.pinned_message`.

    Type:

      `str`

  POLL = 'poll'

    Messages with `telegram.Message.poll`.

    Type:

      `str`

  PROXIMITY_ALERT_TRIGGERED = 'proximity_alert_triggered'

    Messages with `telegram.Message.proximity_alert_triggered`.

    Type:

      `str`

  STICKER = 'sticker'

    Messages with `telegram.Message.sticker`.

    Type:

      `str`

  STORY = 'story'

    Messages with `telegram.Message.story`.

    Type:

      `str`

  SUCCESSFUL_PAYMENT = 'successful_payment'

    Messages with `telegram.Message.successful_payment`.

    Type:

      `str`

  SUPERGROUP_CHAT_CREATED = 'supergroup_chat_created'

    Messages with `telegram.Message.supergroup_chat_created`.

    Type:

      `str`

  TEXT = 'text'

    Messages with `telegram.Message.text`.

    Type:

      `str`

  USERS_SHARED = 'users_shared'

    Messages with `telegram.Message.users_shared`.

    New in version 20.8.

    Type:

      `str`

  VENUE = 'venue'

    Messages with `telegram.Message.venue`.

    Type:

      `str`

  VIDEO = 'video'

    Messages with `telegram.Message.video`.

    Type:

      `str`

  VIDEO_CHAT_ENDED = 'video_chat_ended'

    Messages with `telegram.Message.video_chat_ended`.

    Type:

      `str`

  VIDEO_CHAT_PARTICIPANTS_INVITED = 'video_chat_participants_invited'

    Messages with `telegram.Message.video_chat_participants_invited`.

    Type:

      `str`

  VIDEO_CHAT_SCHEDULED = 'video_chat_scheduled'

    Messages with `telegram.Message.video_chat_scheduled`.

    Type:

      `str`

  VIDEO_CHAT_STARTED = 'video_chat_started'

    Messages with `telegram.Message.video_chat_started`.

    Type:

      `str`

  VIDEO_NOTE = 'video_note'

    Messages with `telegram.Message.video_note`.

    Type:

      `str`

  VOICE = 'voice'

    Messages with `telegram.Message.voice`.

    Type:

      `str`

  WEB_APP_DATA = 'web_app_data'

    Messages with `telegram.Message.web_app_data`.

    New in version 20.8.

    Type:

      `str`

  WRITE_ACCESS_ALLOWED = 'write_access_allowed'

    Messages with `telegram.Message.write_access_allowed`.

    New in version 20.8.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ParseMode(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available parse modes. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  HTML = 'HTML'

    HTML parse mode.

    Type:

      `str`

  MARKDOWN = 'Markdown'

    Markdown parse mode.

    Note

    `MARKDOWN` is a legacy mode, retained by Telegram for backward compatibility. You should use `MARKDOWN_V2` instead.

    Type:

      `str`

  MARKDOWN_V2 = 'MarkdownV2'

    Markdown parse mode version 2.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.PollLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Poll`/`telegram.PollOption`/ `telegram.Bot.send_poll()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_EXPLANATION_LENGTH = 200

    Maximum number of characters in a `str` passed as the `explanation` parameter of `telegram.Poll` and the `explanation` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MAX_EXPLANATION_LINE_FEEDS = 2

    Maximum number of line feeds in a `str` passed as the `explanation` parameter of `telegram.Bot.send_poll()` after entities parsing.

    Type:

      `int`

  MAX_OPEN_PERIOD = 600

    Maximum value allowed for the `open_period` parameter of `telegram.Bot.send_poll()`. Also used in the `close_date` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MAX_OPTION_LENGTH = 100

    Maximum length of each `str` passed in a `list` to the `options` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MAX_OPTION_NUMBER = 10

    Maximum number of strings passed in a `list` to the `options` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MAX_QUESTION_LENGTH = 300

    Maximum value allowed for the `question` parameter of `telegram.Poll` and the `question` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MIN_OPEN_PERIOD = 5

    Minimum value allowed for the `open_period` parameter of `telegram.Bot.send_poll()`. Also used in the `close_date` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MIN_OPTION_LENGTH = 1

    Minimum length of each `str` passed in a `list` to the `options` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MIN_OPTION_NUMBER = 2

    Minimum number of strings passed in a `list` to the `options` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  MIN_QUESTION_LENGTH = 1

    Minimum value allowed for the `question` parameter of `telegram.Poll` and the `question` parameter of `telegram.Bot.send_poll()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.PollType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types for `telegram.Poll`/ `telegram.Bot.send_poll()`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  QUIZ = 'quiz'

    quiz polls.

    Type:

      `str`

  REGULAR = 'regular'

    regular polls.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.PollingLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.get_updates.limit`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_LIMIT = 100

    Maximum value allowed for the `limit` parameter of `telegram.Bot.get_updates()`.

    Type:

      `int`

  MIN_LIMIT = 1

    Minimum value allowed for the `limit` parameter of `telegram.Bot.get_updates()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.ProfileAccentColor(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `Enum`

  This enum contains the available accent colors for `telegram.Chat.profile_accent_color_id`. The members of this enum are named tuples with the following attributes:

  - `identifier` (`int`): The identifier of the accent color.

  - `name` (`str`): Optional. The name of the accent color.

  - `light_colors` (Tuple[`str`]): Optional. The light colors of the accent color as HEX value.

  - `dark_colors` (Tuple[`str`]): Optional. The dark colors of the accent color as HEX value.

  Since Telegram gives no exact specification for the accent colors, future accent colors might have a different data type.

  New in version 20.8.

  COLOR_000 = (0, None, (12211792,), (10241344,))

    Accent color 0. This contains one light color

    and one dark color

  COLOR_001 = (1, None, (12745790,), (9723436,))

    Accent color 1. This contains one light color

    and one dark color

  COLOR_002 = (2, None, (9792200,), (7426201,))

    Accent color 2. This contains one light color

    and one dark color

  COLOR_003 = (3, None, (4825941,), (3371323,))

    Accent color 3. This contains one light color

    and one dark color

  COLOR_004 = (4, None, (4102061,), (3702407,))

    Accent color 4. This contains one light color

    and one dark color

  COLOR_005 = (5, None, (5935035,), (4682132,))

    Accent color 5. This contains one light color

    and one dark color

  COLOR_006 = (6, None, (12079992,), (9717603,))

    Accent color 6. This contains one light color

    and one dark color

  COLOR_007 = (7, None, (8358805,), (4412001,))

    Accent color 7. This contains one light color

    and one dark color

  COLOR_008 = (8, None, (13194845, 14253143), (10044227, 11294782))

    Accent color 8. This contains two light colors

    and two dark colors

  COLOR_009 = (9, None, (13595204, 13407283), (9393455, 10580530))

    Accent color 9. This contains two light colors

    and two dark colors

  COLOR_010 = (10, None, (9855700, 12150454), (6506129, 9588898))

    Accent color 10. This contains two light colors

    and two dark colors

  COLOR_011 = (11, None, (4036437, 9021008), (2714179, 6262596))

    Accent color 11. This contains two light colors

    and two dark colors

  COLOR_012 = (12, None, (4036026, 5287320), (3173500, 4102270))

    Accent color 12. This contains two light colors

    and two dark colors

  COLOR_013 = (13, None, (5475266, 5089469), (3694988, 4557729))

    Accent color 13. This contains two light colors

    and two dark colors

  COLOR_014 = (14, None, (11554676, 13723245), (8929632, 10900057))

    Accent color 14. This contains two light colors

    and two dark colors

  COLOR_015 = (15, None, (6517890, 8096407), (5464174, 3688020))

    Accent color 15. This contains two light colors

    and two dark colors

class telegram.constants.ReactionEmoji(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available emojis of `telegram.ReactionTypeEmoji`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.8.

  ALIEN_MONSTER = '👾'

    Alien monster

    Type:

      `str`

  BANANA = '🍌'

    Banana

    Type:

      `str`

  BOTTLE_WITH_POPPING_CORK = '🍾'

    Bottle with popping cork

    Type:

      `str`

  BROKEN_HEART = '💔'

    Broken heart

    Type:

      `str`

  CHRISTMAS_TREE = '🎄'

    Christmas tree

    Type:

      `str`

  CLAPPING_HANDS = '👏'

    Clapping Hands

    Type:

      `str`

  CLOWN_FACE = '🤡'

    Clown face

    Type:

      `str`

  CRYING_FACE = '😢'

    Crying face

    Type:

      `str`

  DOVE_OF_PEACE = '🕊'

    Dove of peace

    Type:

      `str`

  EYES = '👀'

    Eyes

    Type:

      `str`

  FACE_SCREAMING_IN_FEAR = '😱'

    Face screaming in fear

    Type:

      `str`

  FACE_THROWING_A_KISS = '😘'

    Face throwing a kiss

    Type:

      `str`

  FACE_WITH_ONE_EYEBROW_RAISED = '🤨'

    Face with one eyebrow raised

    Type:

      `str`

  FACE_WITH_OPEN_MOUTH_VOMITING = '🤮'

    Face with open mouth vomiting

    Type:

      `str`

  FACE_WITH_UNEVEN_EYES_AND_WAVY_MOUTH = '🥴'

    Face with uneven eyes and wavy mouth

    Type:

      `str`

  FATHER_CHRISTMAS = '🎅'

    Father christmas

    Type:

      `str`

  FEARFUL_FACE = '😨'

    Fearful face

    Type:

      `str`

  FIRE = '🔥'

    Fire

    Type:

      `str`

  GHOST = '👻'

    Ghost

    Type:

      `str`

  GRINNING_FACE_WITH_ONE_LARGE_AND_ONE_SMALL_EYE = '🤪'

    Grinning face with one large and one small eye

    Type:

      `str`

  GRINNING_FACE_WITH_SMILING_EYES = '😁'

    Grinning face with smiling eyes

    Type:

      `str`

  GRINNING_FACE_WITH_STAR_EYES = '🤩'

    Grinning face with star eyes

    Type:

      `str`

  HANDSHAKE = '🤝'

    Handshake

    Type:

      `str`

  HEART_ON_FIRE = '❤️\u200d🔥'

    Heart on fire

    Type:

      `str`

  HEART_WITH_ARROW = '💘'

    Heart with arrow

    Type:

      `str`

  HEAR_NO_EVIL_MONKEY = '🙉'

    Hear-no-evil monkey

    Type:

      `str`

  HIGH_VOLTAGE_SIGN = '⚡'

    High voltage sign

    Type:

      `str`

  HOT_DOG = '🌭'

    Hot dog

    Type:

      `str`

  HUGGING_FACE = '🤗'

    Hugging face

    Type:

      `str`

  HUNDRED_POINTS_SYMBOL = '💯'

    Hundred points symbol

    Type:

      `str`

  JACK_O_LANTERN = '🎃'

    Jack-o-lantern

    Type:

      `str`

  KISS_MARK = '💋'

    Kiss mark

    Type:

      `str`

  LOUDLY_CRYING_FACE = '😭'

    Loudly crying face

    Type:

      `str`

  MAN_SHRUGGING = '🤷\u200d♂️'

    Man Shrugging

    Type:

      `str`

  MAN_TECHNOLOGIST = '👨\u200d💻'

    Man Technologist

    Type:

      `str`

  MOYAI = '🗿'

    Moyai

    Type:

      `str`

  NAIL_POLISH = '💅'

    Nail polish

    Type:

      `str`

  NERD_FACE = '🤓'

    Nerd face

    Type:

      `str`

  NEUTRAL_FACE = '😐'

    Neutral face

    Type:

      `str`

  NEW_MOON_WITH_FACE = '🌚'

    New moon with face

    Type:

      `str`

  OK_HAND_SIGN = '👌'

    Ok hand sign

    Type:

      `str`

  PARTY_POPPER = '🎉'

    Party popper

    Type:

      `str`

  PERSON_WITH_FOLDED_HANDS = '🙏'

    Person with folded hands

    Type:

      `str`

  PILE_OF_POO = '💩'

    Pile of poo

    Type:

      `str`

  PILL = '💊'

    Pill

    Type:

      `str`

  POUTING_FACE = '😡'

    Pouting face

    Type:

      `str`

  RED_HEART = '❤'

    Red Heart

    Type:

      `str`

  REVERSED_HAND_WITH_MIDDLE_FINGER_EXTENDED = '🖕'

    Reversed hand with middle finger extended

    Type:

      `str`

  ROLLING_ON_THE_FLOOR_LAUGHING = '🤣'

    Rolling on the floor laughing

    Type:

      `str`

  SALUTING_FACE = '🫡'

    Saluting face

    Type:

      `str`

  SEE_NO_EVIL_MONKEY = '🙈'

    See-no-evil monkey

    Type:

      `str`

  SERIOUS_FACE_WITH_SYMBOLS_COVERING_MOUTH = '🤬'

    Serious face with symbols covering mouth

    Type:

      `str`

  SHOCKED_FACE_WITH_EXPLODING_HEAD = '🤯'

    Shocked face with exploding head

    Type:

      `str`

  SHRUG = '🤷'

    Shrug

    Type:

      `str`

  SLEEPING_FACE = '😴'

    Sleeping face

    Type:

      `str`

  SMILING_FACE_WITH_HALO = '😇'

    Smiling face with halo

    Type:

      `str`

  SMILING_FACE_WITH_HEARTS = '🥰'

    Smiling Face with Hearts

    Type:

      `str`

  SMILING_FACE_WITH_HEART_SHAPED_EYES = '😍'

    Smiling face with heart-shaped eyes

    Type:

      `str`

  SMILING_FACE_WITH_HORNS = '😈'

    Smiling face with horns

    Type:

      `str`

  SMILING_FACE_WITH_SUNGLASSES = '😎'

    Smiling face with sunglasses

    Type:

      `str`

  SNOWMAN = '☃'

    Snowman

    Type:

      `str`

  SPEAK_NO_EVIL_MONKEY = '🙊'

    Speak-no-evil monkey

    Type:

      `str`

  SPOUTING_WHALE = '🐳'

    Spouting whale

    Type:

      `str`

  SQUARED_COOL = '🆒'

    Squared cool

    Type:

      `str`

  STRAWBERRY = '🍓'

    Strawberry

    Type:

      `str`

  THINKING_FACE = '🤔'

    Thinking face

    Type:

      `str`

  THUMBS_DOWN = '👎'

    Thumbs Down

    Type:

      `str`

  THUMBS_UP = '👍'

    Thumbs Up

    Type:

      `str`

  TROPHY = '🏆'

    Trophy

    Type:

      `str`

  UNICORN_FACE = '🦄'

    Unicorn face

    Type:

      `str`

  WOMAN_SHRUGGING = '🤷\u200d♀️'

    Woman Shrugging

    Type:

      `str`

  WRITING_HAND = '✍'

    Writing hand

    Type:

      `str`

  YAWNING_FACE = '🥱'

    Yawning face

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ReactionType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.ReactionType`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.8.

  CUSTOM_EMOJI = 'custom_emoji'

    A `telegram.ReactionType` with a custom emoji.

    Type:

      `str`

  EMOJI = 'emoji'

    A `telegram.ReactionType` with a normal emoji.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.ReplyLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.ForceReply` and `telegram.ReplyKeyboardMarkup`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_INPUT_FIELD_PLACEHOLDER = 64

    Maximum value allowed for `input_field_placeholder` parameter of `telegram.ForceReply` and `input_field_placeholder` parameter of `telegram.ReplyKeyboardMarkup`

    Type:

      `int`

  MIN_INPUT_FIELD_PLACEHOLDER = 1

    Minimum value allowed for `input_field_placeholder` parameter of `telegram.ForceReply` and `input_field_placeholder` parameter of `telegram.ReplyKeyboardMarkup`

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

telegram.constants.SUPPORTED_WEBHOOK_PORTS = [443, 80, 88, 8443]

  Ports supported by `telegram.Bot.set_webhook.url`.

  Type:

    List[`int`]

class telegram.constants.StickerFormat(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available formats of `telegram.Sticker` in the set. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.2.

  ANIMATED = 'animated'

    Animated sticker.

    Type:

      `str`

  STATIC = 'static'

    Static sticker.

    Type:

      `str`

  VIDEO = 'video'

    Video sticker.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.StickerLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for various sticker methods, such as `telegram.Bot.create_new_sticker_set()`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_KEYWORD_LENGTH = 64

    Maximum number of characters in a search keyword for a sticker, for each item in `keywords` sequence of `telegram.Bot.set_sticker_keywords()`.

    New in version 20.2.

    Type:

      `int`

  MAX_NAME_AND_TITLE = 64

    Maximum number of characters in a `str` passed as the `name` parameter or the `title` parameter of `telegram.Bot.create_new_sticker_set()`.

    Type:

      `int`

  MAX_SEARCH_KEYWORDS = 20

    Maximum number of search keywords for a sticker, passed as the `keywords` parameter of `telegram.Bot.set_sticker_keywords()`.

    New in version 20.2.

    Type:

      `int`

  MAX_STICKER_EMOJI = 20

    Maximum number of emojis associated with a sticker, passed as the `emoji_list` parameter of `telegram.Bot.set_sticker_emoji_list()`.

    New in version 20.2.

    Type:

      `int`

  MIN_NAME_AND_TITLE = 1

    Minimum number of characters in a `str` passed as the `name` parameter or the `title` parameter of `telegram.Bot.create_new_sticker_set()`.

    Type:

      `int`

  MIN_STICKER_EMOJI = 1

    Minimum number of emojis associated with a sticker, passed as the `emoji_list` parameter of `telegram.Bot.set_sticker_emoji_list()`.

    New in version 20.2.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.StickerSetLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for various sticker set methods, such as `telegram.Bot.create_new_sticker_set()` and `telegram.Bot.add_sticker_to_set()`.

  The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.2.

  MAX_ANIMATED_STICKERS = 50

    Maximum number of stickers allowed in an animated or video sticker set, as given in `telegram.Bot.add_sticker_to_set()`.

    Type:

      `int`

  MAX_ANIMATED_THUMBNAIL_SIZE = 32

    Maximum size of the thumbnail if it is a .TGS or .WEBM in kilobytes, as given in `telegram.Bot.set_sticker_set_thumbnail()`.

    Type:

      `int`

  MAX_EMOJI_STICKERS = 200

    Maximum number of stickers allowed in an emoji sticker set, as given in `telegram.Bot.add_sticker_to_set()`.

    Type:

      `int`

  MAX_INITIAL_STICKERS = 50

    Maximum number of stickers allowed while creating a sticker set, passed as the `stickers` parameter of `telegram.Bot.create_new_sticker_set()`.

    Type:

      `int`

  MAX_STATIC_STICKERS = 120

    Maximum number of stickers allowed in a static sticker set, as given in `telegram.Bot.add_sticker_to_set()`.

    Type:

      `int`

  MAX_STATIC_THUMBNAIL_SIZE = 128

    Maximum size of the thumbnail if it is a .WEBP or .PNG in kilobytes, as given in `telegram.Bot.set_sticker_set_thumbnail()`.

    Type:

      `int`

  MIN_INITIAL_STICKERS = 1

    Minimum number of stickers needed to create a sticker set, passed as the `stickers` parameter of `telegram.Bot.create_new_sticker_set()`.

    Type:

      `int`

  STATIC_THUMB_DIMENSIONS = 100

    Exact height and width of the thumbnail if it is a .WEBP or .PNG in pixels, as given in `telegram.Bot.set_sticker_set_thumbnail()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.StickerType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.Sticker`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  CUSTOM_EMOJI = 'custom_emoji'

    Custom emoji sticker.

    Type:

      `str`

  MASK = 'mask'

    Mask sticker.

    Type:

      `str`

  REGULAR = 'regular'

    Regular sticker.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.UpdateType(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `str`, `enum.Enum`

  This enum contains the available types of `telegram.Update`. The enum members of this enumeration are instances of `str` and can be treated as such.

  New in version 20.0.

  CALLBACK_QUERY = 'callback_query'

    Updates with `telegram.Update.callback_query`.

    Type:

      `str`

  CHANNEL_POST = 'channel_post'

    Updates with `telegram.Update.channel_post`.

    Type:

      `str`

  CHAT_BOOST = 'chat_boost'

    Updates with `telegram.Update.chat_boost`.

    New in version 20.8.

    Type:

      `str`

  CHAT_JOIN_REQUEST = 'chat_join_request'

    Updates with `telegram.Update.chat_join_request`.

    Type:

      `str`

  CHAT_MEMBER = 'chat_member'

    Updates with `telegram.Update.chat_member`.

    Type:

      `str`

  CHOSEN_INLINE_RESULT = 'chosen_inline_result'

    Updates with `telegram.Update.chosen_inline_result`.

    Type:

      `str`

  EDITED_CHANNEL_POST = 'edited_channel_post'

    Updates with `telegram.Update.edited_channel_post`.

    Type:

      `str`

  EDITED_MESSAGE = 'edited_message'

    Updates with `telegram.Update.edited_message`.

    Type:

      `str`

  INLINE_QUERY = 'inline_query'

    Updates with `telegram.Update.inline_query`.

    Type:

      `str`

  MESSAGE = 'message'

    Updates with `telegram.Update.message`.

    Type:

      `str`

  MESSAGE_REACTION = 'message_reaction'

    Updates with `telegram.Update.message_reaction`.

    New in version 20.8.

    Type:

      `str`

  MESSAGE_REACTION_COUNT = 'message_reaction_count'

    Updates with `telegram.Update.message_reaction_count`.

    New in version 20.8.

    Type:

      `str`

  MY_CHAT_MEMBER = 'my_chat_member'

    Updates with `telegram.Update.my_chat_member`.

    Type:

      `str`

  POLL = 'poll'

    Updates with `telegram.Update.poll`.

    Type:

      `str`

  POLL_ANSWER = 'poll_answer'

    Updates with `telegram.Update.poll_answer`.

    Type:

      `str`

  PRE_CHECKOUT_QUERY = 'pre_checkout_query'

    Updates with `telegram.Update.pre_checkout_query`.

    Type:

      `str`

  REMOVED_CHAT_BOOST = 'removed_chat_boost'

    Updates with `telegram.Update.removed_chat_boost`.

    New in version 20.8.

    Type:

      `str`

  SHIPPING_QUERY = 'shipping_query'

    Updates with `telegram.Update.shipping_query`.

    Type:

      `str`

  __add__(value, /)

    Return self+value.

  __contains__(key, /)

    Return bool(key in self).

  __eq__(value, /)

    Return self==value.

  __format__(format_spec)

    Return a formatted version of the string as described by format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __getitem__(key, /)

    Return self[key].

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __iter__()

    Implement iter(self).

  __le__(value, /)

    Return self<=value.

  __len__()

    Return len(self).

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __new__(value)
  __repr__()

    Return repr(self).

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __sizeof__()

    Return the size of the string in memory, in bytes.

  __str__()

    Return str(self).

  capitalize()

    Return a capitalized version of the string.

    More specifically, make the first character have upper case and the rest lower case.

  casefold()

    Return a version of the string suitable for caseless comparisons.

  center(width, fillchar=' ', /)

    Return a centered string of length width.

    Padding is done using the specified fill character (default is a space).

  count(sub[, start[, end]]) → int

    Return the number of non-overlapping occurrences of substring sub in string S[start:end]. Optional arguments start and end are interpreted as in slice notation.

  encode(encoding='utf-8', errors='strict')

    Encode the string using the codec registered for encoding.

    encoding

      The encoding in which to encode the string.

    errors

      The error handling scheme to use for encoding errors. The default is ‘strict’ meaning that encoding errors raise a UnicodeEncodeError. Other possible values are ‘ignore’, ‘replace’ and ‘xmlcharrefreplace’ as well as any other name registered with codecs.register_error that can handle UnicodeEncodeErrors.

  endswith(suffix[, start[, end]]) → bool

    Return True if S ends with the specified suffix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. suffix can also be a tuple of strings to try.

  expandtabs(tabsize=8)

    Return a copy where all tab characters are expanded using spaces.

    If tabsize is not given, a tab size of 8 characters is assumed.

  find(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  format(*args, **kwargs) → str

    Return a formatted version of S, using substitutions from args and kwargs. The substitutions are identified by braces (‘{’ and ‘}’).

  format_map(mapping) → str

    Return a formatted version of S, using substitutions from mapping. The substitutions are identified by braces (‘{’ and ‘}’).

  index(sub[, start[, end]]) → int

    Return the lowest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  isalnum()

    Return True if the string is an alpha-numeric string, False otherwise.

    A string is alpha-numeric if all characters in the string are alpha-numeric and there is at least one character in the string.

  isalpha()

    Return True if the string is an alphabetic string, False otherwise.

    A string is alphabetic if all characters in the string are alphabetic and there is at least one character in the string.

  isascii()

    Return True if all characters in the string are ASCII, False otherwise.

    ASCII characters have code points in the range U+0000-U+007F. Empty string is ASCII too.

  isdecimal()

    Return True if the string is a decimal string, False otherwise.

    A string is a decimal string if all characters in the string are decimal and there is at least one character in the string.

  isdigit()

    Return True if the string is a digit string, False otherwise.

    A string is a digit string if all characters in the string are digits and there is at least one character in the string.

  isidentifier()

    Return True if the string is a valid Python identifier, False otherwise.

    Call keyword.iskeyword(s) to test whether string s is a reserved identifier, such as “def” or “class”.

  islower()

    Return True if the string is a lowercase string, False otherwise.

    A string is lowercase if all cased characters in the string are lowercase and there is at least one cased character in the string.

  isnumeric()

    Return True if the string is a numeric string, False otherwise.

    A string is numeric if all characters in the string are numeric and there is at least one character in the string.

  isprintable()

    Return True if the string is printable, False otherwise.

    A string is printable if all of its characters are considered printable in repr() or if it is empty.

  isspace()

    Return True if the string is a whitespace string, False otherwise.

    A string is whitespace if all characters in the string are whitespace and there is at least one character in the string.

  istitle()

    Return True if the string is a title-cased string, False otherwise.

    In a title-cased string, upper- and title-case characters may only follow uncased characters and lowercase characters only cased ones.

  isupper()

    Return True if the string is an uppercase string, False otherwise.

    A string is uppercase if all cased characters in the string are uppercase and there is at least one cased character in the string.

  join(iterable, /)

    Concatenate any number of strings.

    The string whose method is called is inserted in between each given string. The result is returned as a new string.

    Example: ‘.’.join([‘ab’, ‘pq’, ‘rs’]) -> ‘ab.pq.rs’

  ljust(width, fillchar=' ', /)

    Return a left-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  lower()

    Return a copy of the string converted to lowercase.

  lstrip(chars=None, /)

    Return a copy of the string with leading whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  static maketrans()

    Return a translation table usable for str.translate().

    If there is only one argument, it must be a dictionary mapping Unicode ordinals (integers) or characters to Unicode ordinals, strings or None. Character keys will be then converted to ordinals. If there are two arguments, they must be strings of equal length, and in the resulting dictionary, each character in x will be mapped to the character at the same position in y. If there is a third argument, it must be a string, whose characters will be mapped to None in the result.

  partition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing the original string and two empty strings.

  removeprefix(prefix, /)

    Return a str with the given prefix string removed if present.

    If the string starts with the prefix string, return string[len(prefix):]. Otherwise, return a copy of the original string.

  removesuffix(suffix, /)

    Return a str with the given suffix string removed if present.

    If the string ends with the suffix string and that suffix is not empty, return string[:-len(suffix)]. Otherwise, return a copy of the original string.

  replace(old, new, count=-1, /)

    Return a copy with all occurrences of substring old replaced by new.

    > count

    >   Maximum number of occurrences to replace. -1 (the default value) means replace all occurrences.

    If the optional argument count is given, only the first count occurrences are replaced.

  rfind(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Return -1 on failure.

  rindex(sub[, start[, end]]) → int

    Return the highest index in S where substring sub is found, such that sub is contained within S[start:end]. Optional arguments start and end are interpreted as in slice notation.

    Raises ValueError when the substring is not found.

  rjust(width, fillchar=' ', /)

    Return a right-justified string of length width.

    Padding is done using the specified fill character (default is a space).

  rpartition(sep, /)

    Partition the string into three parts using the given separator.

    This will search for the separator in the string, starting at the end. If the separator is found, returns a 3-tuple containing the part before the separator, the separator itself, and the part after it.

    If the separator is not found, returns a 3-tuple containing two empty strings and the original string.

  rsplit(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the end of the string and works to the front.

  rstrip(chars=None, /)

    Return a copy of the string with trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  split(sep=None, maxsplit=-1)

    Return a list of the substrings in the string, using sep as the separator string.

    > sep

    >   The separator used to split the string.

    >   When set to None (the default value), will split on any whitespace character (including n r t f and spaces) and will discard empty strings from the result.

    > maxsplit

    >   Maximum number of splits. -1 (the default value) means no limit.

    Splitting starts at the front of the string and works to the end.

    Note, str.split() is mainly useful for data that has been intentionally delimited. With natural text that includes punctuation, consider using the regular expression module.

  splitlines(keepends=False)

    Return a list of the lines in the string, breaking at line boundaries.

    Line breaks are not included in the resulting list unless keepends is given and true.

  startswith(prefix[, start[, end]]) → bool

    Return True if S starts with the specified prefix, False otherwise. With optional start, test S beginning at that position. With optional end, stop comparing S at that position. prefix can also be a tuple of strings to try.

  strip(chars=None, /)

    Return a copy of the string with leading and trailing whitespace removed.

    If chars is given and not None, remove characters in chars instead.

  swapcase()

    Convert uppercase characters to lowercase and lowercase characters to uppercase.

  title()

    Return a version of the string where each word is titlecased.

    More specifically, words start with uppercased characters and all remaining cased characters have lower case.

  translate(table, /)

    Replace each character in the string using the given translation table.

    > table

    >   Translation table, which must be a mapping of Unicode ordinals to Unicode ordinals, strings, or None.

    The table must implement lookup/indexing via __getitem__, for instance a dictionary or list. If this operation raises LookupError, the character is left untouched. Characters mapped to None are deleted.

  upper()

    Return a copy of the string converted to uppercase.

  zfill(width, /)

    Pad a numeric string with zeros on the left, to fill a field of the given width.

    The string is never truncated.

class telegram.constants.UserProfilePhotosLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.get_user_profile_photos.limit`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_LIMIT = 100

    Maximum value allowed for `limit` parameter of `telegram.Bot.get_user_profile_photos()`.

    Type:

      `int`

  MIN_LIMIT = 1

    Minimum value allowed for `limit` parameter of `telegram.Bot.get_user_profile_photos()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

class telegram.constants.WebhookLimit(value, names=None, *values, module=None, qualname=None, type=None, start=1, boundary=None)

  Bases: `enum.IntEnum`

  This enum contains limitations for `telegram.Bot.set_webhook.max_connections` and `telegram.Bot.set_webhook.secret_token`. The enum members of this enumeration are instances of `int` and can be treated as such.

  New in version 20.0.

  MAX_CONNECTIONS_LIMIT = 100

    Maximum value allowed for the `max_connections` parameter of `telegram.Bot.set_webhook()`.

    Type:

      `int`

  MAX_SECRET_TOKEN_LENGTH = 256

    Maximum length of the secret token for the `secret_token` parameter of `telegram.Bot.set_webhook()`.

    Type:

      `int`

  MIN_CONNECTIONS_LIMIT = 1

    Minimum value allowed for the `max_connections` parameter of `telegram.Bot.set_webhook()`.

    Type:

      `int`

  MIN_SECRET_TOKEN_LENGTH = 1

    Minimum length of the secret token for the `secret_token` parameter of `telegram.Bot.set_webhook()`.

    Type:

      `int`

  __abs__()

    abs(self)

  __add__(value, /)

    Return self+value.

  __and__(value, /)

    Return self&value.

  __bool__()

    True if self else False

  __ceil__()

    Ceiling of an Integral returns itself.

  __divmod__(value, /)

    Return divmod(self, value).

  __eq__(value, /)

    Return self==value.

  __float__()

    float(self)

  __floor__()

    Flooring an Integral returns itself.

  __floordiv__(value, /)

    Return self//value.

  __format__(format_spec, /)

    Convert to a string according to format_spec.

  __ge__(value, /)

    Return self>=value.

  __getattribute__(name, /)

    Return getattr(self, name).

  __gt__(value, /)

    Return self>value.

  __hash__()

    Return hash(self).

  __index__()

    Return self converted to an integer, if self is suitable for use as an index into a list.

  __int__()

    int(self)

  __invert__()

    ~self

  __le__(value, /)

    Return self<=value.

  __lshift__(value, /)

    Return self<<value.

  __lt__(value, /)

    Return self<value.

  __mod__(value, /)

    Return self%value.

  __mul__(value, /)

    Return self*value.

  __ne__(value, /)

    Return self!=value.

  __neg__()

    -self

  __new__(value)
  __or__(value, /)

    Return self|value.

  __pos__()

    +self

  __pow__(value, mod=None, /)

    Return pow(self, value, mod).

  __radd__(value, /)

    Return value+self.

  __rand__(value, /)

    Return value&self.

  __rdivmod__(value, /)

    Return divmod(value, self).

  __repr__()

    Return repr(self).

  __rfloordiv__(value, /)

    Return value//self.

  __rlshift__(value, /)

    Return value<<self.

  __rmod__(value, /)

    Return value%self.

  __rmul__(value, /)

    Return value*self.

  __ror__(value, /)

    Return value|self.

  __round__()

    Rounding an Integral returns itself.

    Rounding with an ndigits argument also returns an integer.

  __rpow__(value, mod=None, /)

    Return pow(value, self, mod).

  __rrshift__(value, /)

    Return value>>self.

  __rshift__(value, /)

    Return self>>value.

  __rsub__(value, /)

    Return value-self.

  __rtruediv__(value, /)

    Return value/self.

  __rxor__(value, /)

    Return value^self.

  __sizeof__()

    Returns size in memory, in bytes.

  __str__()

    Return repr(self).

  __sub__(value, /)

    Return self-value.

  __truediv__(value, /)

    Return self/value.

  __trunc__()

    Truncating an Integral returns itself.

  __xor__(value, /)

    Return self^value.

  as_integer_ratio()

    Return a pair of integers, whose ratio is equal to the original int.

    The ratio is in lowest terms and has a positive denominator.

        >>> (10).as_integer_ratio()
        (10, 1)
        >>> (-10).as_integer_ratio()
        (-10, 1)
        >>> (0).as_integer_ratio()
        (0, 1)

  bit_count()

    Number of ones in the binary representation of the absolute value of self.

    Also known as the population count.

        >>> bin(13)
        '0b1101'
        >>> (13).bit_count()
        3

  bit_length()

    Number of bits necessary to represent self in binary.

        >>> bin(37)
        '0b100101'
        >>> (37).bit_length()
        6

  conjugate()

    Returns self, the complex conjugate of any int.

  denominator

    the denominator of a rational number in lowest terms

  from_bytes(byteorder='big', *, signed=False)

    Return the integer represented by the given array of bytes.

    bytes

      Holds the array of bytes to convert. The argument must either support the buffer protocol or be an iterable object producing bytes. Bytes and bytearray are examples of built-in objects that support the buffer protocol.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Indicates whether two’s complement is used to represent the integer.

  imag

    the imaginary part of a complex number

  is_integer()

    Returns True. Exists for duck type compatibility with float.is_integer.

  numerator

    the numerator of a rational number in lowest terms

  real

    the real part of a complex number

  to_bytes(length=1, byteorder='big', *, signed=False)

    Return an array of bytes representing an integer.

    length

      Length of bytes object to use. An OverflowError is raised if the integer is not representable with the given number of bytes. Default is length 1.

    byteorder

      The byte order used to represent the integer. If byteorder is ‘big’, the most significant byte is at the beginning of the byte array. If byteorder is ‘little’, the most significant byte is at the end of the byte array. To request the native byte order of the host system, use `sys.byteorder’ as the byte order value. Default is to use ‘big’.

    signed

      Determines whether two’s complement is used to represent the integer. If signed is False and a negative integer is given, an OverflowError is raised.

telegram.constants.ZERO_DATE = datetime.datetime(1970, 1, 1, 0, 0, tzinfo=<UTC>)

  `datetime.datetime`, value of unix 0. This date literal is used in `telegram.InaccessibleMessage`

  New in version 20.8.