From c702efe58503c68411e3fd76d40adbec2a6a46ff Mon Sep 17 00:00:00 2001 From: Someone Date: Mon, 10 Jan 2022 17:00:59 +0100 Subject: [PATCH] modules/CommandCoronaPresenceLogger.py --- modules/CommandCoronaPresenceLogger.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/CommandCoronaPresenceLogger.py b/modules/CommandCoronaPresenceLogger.py index 63e4449..5e6e326 100644 --- a/modules/CommandCoronaPresenceLogger.py +++ b/modules/CommandCoronaPresenceLogger.py @@ -17,7 +17,7 @@ from AbstractCommand import AbstractCommand class CommandCoronaPresenceLogger(AbstractCommand): TRIGGER = "cpl" CONFIG = {"display_name": "somebot-command", "auto_complete": False} - CONFIG["description"] = "Corona-presence-logging" + CONFIG["description"] = AbstractCommand.ICON_PRIVATE+"Corona-presence-logging" USEINFO = cleandoc(""" ``/cpl`` is our approach to corona related presence logging at fsinf. Use ``/cpl --yes`` to get your presence at fsinf today logged. @@ -45,16 +45,16 @@ class CommandCoronaPresenceLogger(AbstractCommand): self.channel_index_th.setDaemon(True) self.channel_index_th.start() - request.cmd_respond_text_chan("``AUTODELETE-DAY`` **``CPL, OIDA!``**", props={"cpl-meme-upload-todo":"todo"}) + request.respond_cmd_chan("``AUTODELETE-DAY`` **``CPL, OIDA!``**", props={"cpl-meme-upload-todo":"todo"}) - # accept all. - #elif re.match(r"^(-|—|–)+y(e|a+)s$", data['text']): - if re.match(r"^(-|—|–)+", data['text']): + elif re.match(r"^(-|—|–)+", data['text']): filename = self.datadir + datetime.date.today().isoformat()+"--"+data["user_id"] with open(filename, "a") as f: f.write(data["user_name"]+" -- "+datetime.datetime.now().isoformat()+"\n") - request.cmd_respond_text_temp(cleandoc(""" - ## :white_check_mark: ``Your presence at FSINF today has been logged.`` :white_check_mark: + request.respond_cmd_temp(cleandoc(""" + ## :white_check_mark: Success! :) + #### ``Your presence at FSINF today has been logged.`` + This information is retained for about a month. If we get informed of somebody testing COVID-19 positive, we shall inform anyone being at fsinf on the same days. @@ -64,7 +64,7 @@ class CommandCoronaPresenceLogger(AbstractCommand): self.bot.debug_chan("``/cpl`` presence logged: ``"+data["user_name"]+"``") else: - request.cmd_respond_text_temp("## :warning: Please use ``/cpl --yes`` to confirm your presence at fsinf. :warning: \n\n"+self.USEINFO) + request.respond_err("Please use ``/cpl --yes`` to confirm your presence at fsinf. \n\n"+self.USEINFO) # racecondition if called in the same channel too fast. nonissue? -- 2.43.0