fix loop and youtube link

This commit is contained in:
fram3d 2024-02-05 20:22:41 +01:00
parent 2de31fc3ef
commit 3b86c53c7c
Signed by: fram3d
GPG Key ID: 938920E709EEA32A

View File

@ -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')