messages sent by bot now added to database
authorGeorgios Atheridis <atheridis@tutamail.com>
Fri, 30 Sep 2022 17:25:45 +0000 (17:25 +0000)
committerGeorgios Atheridis <atheridis@tutamail.com>
Fri, 30 Sep 2022 17:25:45 +0000 (17:25 +0000)
skgyorugo/auto_messages/caedrel.py [new file with mode: 0644]
skgyorugo/tools/smart_privmsg.py

diff --git a/skgyorugo/auto_messages/caedrel.py b/skgyorugo/auto_messages/caedrel.py
new file mode 100644 (file)
index 0000000..d3f2c1b
--- /dev/null
@@ -0,0 +1,9 @@
+from aptbot.bot import Message, Commands, Bot
+
+COOLDOWN = 90 * 60
+END_TIME = 0
+
+
+def main(bot: Bot, message: Message):
+    msg = "Watch caedrel react to peks KEKW https://clips.twitch.tv/GentleNimbleStarPrimeMe-sZRWuCU6llKgbAlh"
+    bot.send_privmsg(message.channel, msg)
index 13c477de16e9a580e8a5680d6c0485c4f07da83c..92bfe148379233dac1c9a9945ac39b8d82bc54fa 100644 (file)
@@ -1,5 +1,7 @@
 from aptbot.bot import Bot, Message, Commands
 from typing import Union
+from .. import database_manager
+import time
 
 MAX_LENGTH = 480
 
@@ -62,6 +64,18 @@ def send(
     message = message.replace("{channel}", message_data.channel)
 
     messages = _split_message(message)
+    for message in messages:
+        if reply:
+            tags = {"display-name": "MurphyAI", "tmi-sent-ts": int(time.time() * 1000), "user-id": "784114488", "room-id": "169701299", "reply-parent-msg-id": reply}
+        database_manager.add_message_tochat_history(
+            Message(
+                tags=tags,
+                nick="murphyai",
+                command=Commands.PRIVMSG,
+                message_data.channel,
+                value=message
+            )
+        )
     if safe_send:
         send_safe(bot, message_data.channel, messages, reply)
     else: