bot.userdata Module#
A custom user data class.
- bot.userdata.CCT
Type alias for
telegram.ext.CallbackContext
withUserData
as user data.alias of
CallbackContext
[ExtBot
,UserData
,dict
,dict
]
- class bot.userdata.UserData(user_id=None, username=None, first_name=None, full_name=None, photo_file_unique_id=None, fallback_photo=None, sticker_file_ids=None, temp_file_ids=None, store_stickers=True, tzinfo='UTC', text_direction='ltr')
Bases:
object
Custom class to store information relevant for each user.
- Parameters:
photo_file_unique_id (
Optional
[str
]) – The users current photos unique file id.fallback_photo (
Optional
[PhotoSize
]) – The users fallback photosticker_file_ids (
Dict
[str
,str
]) – Mapping file unique id → file id of stickers sent by the user for later use.temp_file_ids (
Dict
[str
,Tuple
[str
,str
]]) – Temporarily saved file ids of stickers generated by the user.store_stickers (
Optional
[bool
]) – Whether or not this users wants to store stickers. Defaults toTrue
.tzinfo (
str
) – Users timezone. Defaults to UTC.text_direction (
str
) – Users preferred text direction. Defaults to left-to-right.
- user_id
The users id.
- username
The users username
- first_name
The users first name.
- full_name
The users full name.
- photo_file_unique_id
The users current photos unique file id.
- fallback_photo
The users fallback photo
- sticker_file_ids
Mapping file unique id → file id of stickers sent by the user for later use.
- temp_file_ids
Temporarily saved file ids of stickers generated by the user.
- store_stickers
Whether or not this users wants to store stickers. Defaults to
True
.
- inline_query_task
Optional. A
asyncio.Task
which answers the current inline query.
- inline_query_event
Optional. An
tasking.Event
. Setting this event will causeinline_query_task
to terminate.
- tzinfo
Users timezone.
- text_direction
Users preferred text direction.
- update_fallback_photo(fallback_photo)
Updates fallback photo for this user.