General Functions¶
-
misbot.general.start(bot, update)¶ Initial message sent to all users. Starts registration conversation, passes control to
credentials()
-
misbot.general.register(bot, update, user_data)¶ Let all users register with their credentials. Similar to
start()but this function can be invoked by/registercommand.If user’s
chatID&DOBare already present in database then ends the conversation. Otherwise, if onlychatIDis present, then storesStudentID(PID) inuser_datadict & gives control toparent_login()function.If both conditions are false, then asks user to input Student details (PID & Password) and gives control to
credentials()
-
misbot.general.credentials(bot, update, user_data)¶ Store user credentials in a database. Takes student info (PID & password) from
update.message.textand splits it into Student_ID & Password and checks if they are correct withmisbot.mis_utils.check_login()and stores them in theChattable. Finally, sends message asking users to enter DOB and gives control toparent_login()after storingStudent_ID(PID) in user_data dict.
-
misbot.general.parent_login(bot, update, user_data)¶ user_data dict contains
Student_IDkey fromcredentials(). Extracts DOB fromupdate.message.textand checks validity usingmisbot.mis_utils.check_parent_login()before adding it to database. Finally, sends a message to the user requesting them to start using/attendanceor/itinerarycommands.
-
misbot.general.delete(bot, update)¶ Delete a user’s credentials if they wish to stop using the bot or update them.
-
misbot.general.cancel(bot, update)¶ Cancel registration operation (terminates conv_handler)
-
misbot.general.unknown(bot, update)¶ Respond to incomprehensible messages/commands with some canned responses.
-
misbot.general.help_text(bot, update)¶ Display help text.
-
misbot.general.tips(bot, update)¶ Send a random tip about the bot.
-
misbot.general.error_callback(bot, update, error)¶ Simple error handling function. Handles PTB lib errors
-
misbot.general.subscription(bot, update)¶ Sends text detailing the subscription model