From 45d6d365080c2caae51596b7b9ca8ceb9f2bf76a Mon Sep 17 00:00:00 2001 From: Georgios Atheridis Date: Wed, 25 Jan 2023 20:03:17 +0000 Subject: [PATCH] Bot sends message when user gets timed out --- ihaspeks/main.py | 3 +++ ihaspeks/scripts/will_be_missed.py | 12 ++++++++++++ 2 files changed, 15 insertions(+) create mode 100644 ihaspeks/scripts/will_be_missed.py diff --git a/ihaspeks/main.py b/ihaspeks/main.py index 66d5398..0b5b3e8 100644 --- a/ihaspeks/main.py +++ b/ihaspeks/main.py @@ -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 index 0000000..e462349 --- /dev/null +++ b/ihaspeks/scripts/will_be_missed.py @@ -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) -- 2.30.2