From 369d6a042cdd75a816e9de69cacfb824ea71c759 Mon Sep 17 00:00:00 2001 From: swee Date: Fri, 6 Dec 2024 18:44:26 -0800 Subject: [PATCH] Update sweebot.py --- sweebot.py | 53 ++++++++++++----------------------------------------- 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/sweebot.py b/sweebot.py index bb74c58..3c9612d 100644 --- a/sweebot.py +++ b/sweebot.py @@ -1,4 +1,4 @@ -__version__ = "0.0.2 Funni update" +__version__ = "0.0.2 Funni update" + ". https://git.swee.codes/MeowNex" import socket import subprocess from time import sleep, time, ctime @@ -223,6 +223,7 @@ baps = ["T-T", "Ow!", "Beep!"] pats = ["-w-", "Meep...", "Prr!"] meows_happy = ['Meow!', 'Nyaa~', 'Mrow.', 'Prr! :3', "Mrrp?", "Mreow.", "!woeM", "3: !rrP", "~aayN", "Mew!", "Moew!"] meows_upset = ['Hiss!', "!ssiH", "Grrr..."] +my_self = ["MeowNexUS", "MeowNexU5", "MeowN3xUS"] happiness = 5 global times times = 0 @@ -318,7 +319,7 @@ while True: pass try: #if True: - if "PRIVMSG" in text: + if "PRIVMSG" in text and not nick in my_self: if "PRIVMSG" in text and command[0][0] == "$": run+=1 update() @@ -561,45 +562,15 @@ while True: multiline(f"\x01ACTION gives a hug to {name}\x01", channel) - - #elif command[0] == "$sed": - # if len(command) > 1: - #try: - # if True: - # com = ['sed',"" + command[1] + ""] - # print(command[1]) - # texte = open("log-text-"+channel).read().split("\n") - # texte.reverse() - # texte.pop(0) - # texte.pop(0) - # print(texte) - # texttoreplace = "" - # j = 0 - # broken = False - # for i in texte: - # if command[1].split("/")[1] in i: - # texttoreplace = i - # broken = True - # break - # j+=1 - # if not broken: - # irc.send_irc(channel, "Unable to correct: '" + command[1].split("/")[1] + "' not found in any chat message.") - # continue - # namee = open("log-name-"+channel).read().split("\n") - # namee.reverse() - # namee.pop(0) - # namee.pop(0) - # namee = namee[j] - # open("temp","w").write(texttoreplace) - # com.append("temp") - # print(com) - # result = subprocess.run(com, stdout=subprocess.PIPE) - # output = result.stdout.decode('utf-8').split("\n") - # irc.send_irc(channel, "Correction using sed: <" + namee + "> " + output[0]) - # #except Exception as ex: - # #irc.send_irc(channel, nick + ": " + ex.__class__.__name__) - # else: - # irc.send_irc(channel, nick + ": What to correct?") + elif command[0] == "$sed": + if len(command) > 1: + try: + #if True: + raise Exception("WorkInProgress!!!") + except: + print(traceback.format_exc()) + else: + irc.send_irc(channel, nick + ": What to correct?") elif command[0] == "$config":