Bot sends message when user gets timed out
authorGeorgios Atheridis <georgios@atheridis.org>
Wed, 25 Jan 2023 20:03:17 +0000 (20:03 +0000)
committerGeorgios Atheridis <georgios@atheridis.org>
Wed, 25 Jan 2023 20:15:07 +0000 (20:15 +0000)
ihaspeks/main.py
ihaspeks/scripts/will_be_missed.py [new file with mode: 0644]

index 66d5398e85a11ed2f39e50b7f03619ae07e92ce1..0b5b3e888d11ca95c9a8d3846a41f4b55ac5f272 100644 (file)
@@ -15,6 +15,7 @@ import scripts.chat
 import scripts.crylaugh
 import scripts.clean_queue
 import scripts.discord_start_stream
+import scripts.will_be_missed
 import database_manager
 import analyze_auto_message
 import time
@@ -34,6 +35,7 @@ reload(scripts.chat)
 reload(scripts.crylaugh)
 reload(scripts.clean_queue)
 reload(scripts.discord_start_stream)
+reload(scripts.will_be_missed)
 reload(database_manager)
 reload(analyze_auto_message)
 
@@ -145,6 +147,7 @@ def main(bot: Bot, message: Message):
         scripts.chatting.chatting_annoy(bot, message)
         scripts.chat.chat(bot, message)
         scripts.crylaugh.crylaugh(bot, message)
+    scripts.will_be_missed.will_be_missed(bot, message)
 
     # if message.command == Commands.PART:
     #     if message.nick in {'jelemar', 'flauenn', 'ihaspeks', 'blobin_wobin', 'officiallysp'}:
diff --git a/ihaspeks/scripts/will_be_missed.py b/ihaspeks/scripts/will_be_missed.py
new file mode 100644 (file)
index 0000000..e462349
--- /dev/null
@@ -0,0 +1,12 @@
+from aptbot.bot import Bot, Message, Commands
+import tools.smart_privmsg
+
+
+def will_be_missed(bot: Bot, message: Message):
+    if message.command != Commands.CLEARCHAT:
+        return
+    if "ban-duration" not in message.tags.keys():
+        return
+
+    msg = f"Joel {message.value} will be missed KEKBye"
+    tools.smart_privmsg.send(bot, message, msg)