-
Notifications
You must be signed in to change notification settings - Fork 0
Create Handler and Data Management
Miguel Tenorio edited this page Nov 10, 2020
·
2 revisions
The /create command tries to make the current chat available for configuration by the administrator that trigger this handler. Is helpful to understand how we manage our data, so that's what this wiki is about.
python-telegram-bot allow us to save wherever data we need to save in some dictionaries in a CallbackContext object. These dictionaries are named chat_data, user_data and bot_data.
Read the docs of
python-telegram-botfor details aboutpython-telegram-botobjects and features.
The data we save is:
-
chat_data['active']:Trueif a chat group has a active discussion,Falseotherwise. -
chat_data['manager']: User id of the user that start the discussion of the chat, and the one who configures it -
chat_data['model']: Current model -
chat_data['voters']: Dict ofuser_id : vote.voteisNoneif the user with user IDuser_idis registered in the discussion but isn't voted yet. -
user_data['owner']: Contain the chat IDs of the chats of which the user is manager -
user_data['options']: List of the options which order will be discussed -
user_data['chat_id']: Chat ID of the chat being configured by the user -
user_data['voting_in']: List of chat IDs of the chats the user is voting on.
Wiki of Matcom Scheduler © Copyright 2019-2020 – Licensed by 2kodevs