forked from Decentrala/chatbot
testne komande
This commit is contained in:
parent
d2438e59ea
commit
2de31fc3ef
9
chatbot
9
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')
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user