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

# PersistenceInput

class telegram.ext.PersistenceInput(bot_data=True, chat_data=True, user_data=True, callback_data=True)

  Bases: `NamedTuple`

  Convenience wrapper to group boolean input for the `store_data` parameter for `BasePersistence`.

  Parameters:

    - bot_data (`bool`, optional) – Whether the setting should be applied for `bot_data`. Defaults to `True`.

    - chat_data (`bool`, optional) – Whether the setting should be applied for `chat_data`. Defaults to `True`.

    - user_data (`bool`, optional) – Whether the setting should be applied for `user_data`. Defaults to `True`.

    - callback_data (`bool`, optional) – Whether the setting should be applied for `callback_data`. Defaults to `True`.

  bot_data

    Whether the setting should be applied for `bot_data`.

    Type:

      `bool`

  chat_data

    Whether the setting should be applied for `chat_data`.

    Type:

      `bool`

  user_data

    Whether the setting should be applied for `user_data`.

    Type:

      `bool`

  callback_data

    Whether the setting should be applied for `callback_data`.

    Type:

      `bool`

  Available In

  - `telegram.ext.BasePersistence.store_data`

  - `telegram.ext.DictPersistence.store_data`

  - `telegram.ext.PicklePersistence.store_data`