From 61f5d546ec7b232e31dd8e6ee0fa93b1761bae3a Mon Sep 17 00:00:00 2001 From: manetta Date: Sun, 7 Mar 2021 10:55:29 +0100 Subject: [PATCH] adding comments to the different sections of the code --- LogBot/logbot.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/LogBot/logbot.py b/LogBot/logbot.py index aae8851..6f1101b 100644 --- a/LogBot/logbot.py +++ b/LogBot/logbot.py @@ -172,7 +172,7 @@ class Logbot(Bot): self.log.info(f"sender: { message.sender }") self.log.info("------------------") - # image / PDF / audio / video + # Response to files: image / PDF / audio / video if message.url: media_post, media_type = self._download(message) if media_post: @@ -182,10 +182,12 @@ class Logbot(Bot): else: reply = "Sorry, can't process that :( (unknown media type?)" + # Response to @add elif "@add" in message.text: self._add_to_db(message) reply = "Added, thanks!" + # Response to @delete elif "@delete" in message.text: match = re.findall(r"@delete \d*", message.content)[0] key = str(match.replace("@delete ", "")) @@ -199,12 +201,14 @@ class Logbot(Bot): else: reply = "This message is already gone!" + # Response to @title elif "@title" in message.text: match = re.findall("@title .*", message.content)[0] title = match.replace("@title", "") self.db[message.room]["title"] = title reply = f"The title of the log is changed to: { title }" + # Response to @style elif "@style" in message.text: reply = "This is a future-feature ..."