Admin¶
-
misbot.admin.push_notification(bot, update)¶ Starts Push notification conversation. Asks for message and transfers control to
notification_message()Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object
Returns: NOTIF_MESSAGE
Return type: int
-
misbot.admin.notification_message(bot, update, user_data)¶ Ask for confirmation, stores the message in
user_datadictionary, transfer control tonotification_confirm()Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object
- user_data (dict) – User data dictionary
Returns: NOTIF_CONFIRM
Return type: int
-
misbot.admin.notification_confirm(bot, update, user_data)¶ Sends message if “Yes” is sent. Aborts if “No” is sent. Sends a message with statistics like users reached, time taken after sending push notification.
Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object
- user_data (dict) – User data dictionary
Returns: ConversationHandler.END
Return type: int
-
misbot.admin.revert_notification(bot, update)¶ Delete a previously sent push notification. Ask for
uuidof message to delete and pass control toask_uuid()Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object
-
misbot.admin.ask_uuid(bot, update, user_data)¶ Store the
uuid, send confirmation message and pass control toconfirm_revert()Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object
- user_data (dict) – Conversation data
-
misbot.admin.confirm_revert(bot, update, user_data)¶ If Yes, revert the specified message for all users and send a summary of the operation to admin.
Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object
- user_data (dict) – Conversation data
-
misbot.admin.clean_all_attendance_records(bot, update)¶ Activated by
/cleancommand. Seemisbot.mis_utils.clean_attendance_records()to see what this does.Parameters: - bot (telegram.bot.Bot) – Telegram Bot object
- update (telegram.update.Update) – Telegram Update object