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

# MessageOriginUser

class telegram.MessageOriginUser(date, sender_user, *, api_kwargs=None)

  Bases: `telegram.MessageOrigin`

  The message was originally sent by a known user.

  Available In

  - `telegram.ExternalReplyInfo.origin`

  - `telegram.Message.forward_origin`

  New in version 20.8.

  Parameters:

    - date (`datetime.datetime`) – Date the message was sent originally. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    - sender_user (`telegram.User`) – User that sent the message originally.

  type

    Type of the message origin. Always `'user'`.

    Type:

      `str`

  date

    Date the message was sent originally. The default timezone of the bot is used for localization, which is UTC unless `telegram.ext.Defaults.tzinfo` is used.

    Type:

      `datetime.datetime`

  sender_user

    User that sent the message originally.

    Type:

      `telegram.User`