verif_processing ================ .. py:module:: verif_processing Attributes ---------- .. autoapisummary:: verif_processing.logger verif_processing.API_TOKEN verif_processing.BOT_USERNAME verif_processing.P_HTML verif_processing.WAITING_TIME verif_processing.bot Functions --------- .. autoapisummary:: verif_processing.send_reminder verif_processing.send_alert_message verif_processing.check_for_response Module Contents --------------- .. py:data:: logger Logger for the Queue Process service module .. py:data:: API_TOKEN The API token for the Telegram bot, retrieved from the configuration file. .. py:data:: BOT_USERNAME The username of the Telegram bot, retrieved from the configuration file. .. py:data:: P_HTML Parse mode set to HTML for formatting Telegram messages. .. py:data:: WAITING_TIME :value: 9 The default waiting time (in minutes) before sending the next reminder. .. py:data:: bot The Telegram bot object used to send messages and interact with users. .. py:function:: send_reminder(user_id: int, username: str, reminder_count: int) -> telegram.Message :async: Sends a reminder message to a user, prompting them to respond to a verification message. :param user_id: The Telegram user ID to send the message to. :type user_id: int :param username: The username of the user for logging purposes. :type username: str :param reminder_count: The count of the reminder being sent. :type reminder_count: int :returns: The Telegram message object representing the sent reminder. :rtype: Message .. py:function:: send_alert_message(user_id: int, verif_time: datetime.datetime.time, desc: str) -> telegram.Message :async: Sends an alert message to a user's emergency contacts if the user fails to respond. :param user_id: The Telegram user ID to alert. :type user_id: int :param verif_time: The time when the verification was supposed to occur. :type verif_time: datetime.time :param desc: Description provided for the callback. :type desc: str :returns: The Telegram message object sent to the user after alerting their contacts. :rtype: Message .. py:function:: check_for_response() -> None :async: Continuously checks for user responses and manages the reminder and alert system. This function runs an infinite loop that checks for user responses to scheduled verification messages. If a response is not received within the set waiting time, it sends reminders. If the user fails to respond after several reminders, it sends alerts to emergency contacts. The function also manages the queue of users to be checked and updates their status accordingly.