diff --git a/chatbot b/chatbot index 27c9814..9cde5ed 100755 --- a/chatbot +++ b/chatbot @@ -9,7 +9,12 @@ CONFIG_PATH = "./config.ini" VERSION='0.1.0' def processmsg(msg, rcpt): - return f"Echo: {msg}" + if !msg.startswith("!"): + return "" + if msg.startswith("http"): + return "link" + elif "youtube" in msg: + return msg.replace("youtube.com", "iv.datura.network") def show_version(): print("chatbot " + VERSION) @@ -36,7 +41,7 @@ class MUCBot(slixmpp.ClientXMPP): def muc_message(self, msg): rcpt=msg['from'].bare processmsg(msg['body'], rcpt) - if msg['mucnick'] != self.nick: + if msg['type'] in ('chat', 'normal'): self.send_message(mto=rcpt,mbody="%s: %s" % (msg['mucnick'],msg['body']),mtype='groupchat')