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

# ChatMemberBanned

class telegram.ChatMemberBanned(user, until_date, *, api_kwargs=None)

  Bases: `telegram.ChatMember`

  Represents a chat member that was banned in the chat and can’t return to the chat or view chat messages.

  Available In

  - `telegram.ChatMemberUpdated.new_chat_member`

  - `telegram.ChatMemberUpdated.old_chat_member`

  Returned In

  `telegram.Bot.get_chat_member()`

  New in version 13.7.

  Parameters:

    - user (`telegram.User`) – Information about the user.

    - until_date (`datetime.datetime`) –

      Date when restrictions will be lifted for this user.

      > Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

  status

    The member’s status in the chat, always `'kicked'`.

    Type:

      `str`

  user

    Information about the user.

    Type:

      `telegram.User`

  until_date

    Date when restrictions will be lifted for this user.

    > Changed in version 20.3: The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    Type:

      `datetime.datetime`