From 3b86c53c7c2cb9f43d98641cdda0f17f100177aa Mon Sep 17 00:00:00 2001 From: fram3d Date: Mon, 5 Feb 2024 20:22:41 +0100 Subject: [PATCH] fix loop and youtube link --- chatbot | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/chatbot b/chatbot index 9cde5ed..e056407 100755 --- a/chatbot +++ b/chatbot @@ -11,9 +11,7 @@ VERSION='0.1.0' def processmsg(msg, rcpt): if !msg.startswith("!"): return "" - if msg.startswith("http"): - return "link" - elif "youtube" in msg: + elif "youtube.com/watch" in msg: return msg.replace("youtube.com", "iv.datura.network") def show_version(): @@ -41,7 +39,7 @@ class MUCBot(slixmpp.ClientXMPP): def muc_message(self, msg): rcpt=msg['from'].bare processmsg(msg['body'], rcpt) - if msg['type'] in ('chat', 'normal'): + if msg['mucnick'] != self.nick): self.send_message(mto=rcpt,mbody="%s: %s" % (msg['mucnick'],msg['body']),mtype='groupchat')