fix typos
This commit is contained in:
parent
3b86c53c7c
commit
c914de3358
11
chatbot
11
chatbot
@ -9,7 +9,7 @@ CONFIG_PATH = "./config.ini"
|
||||
VERSION='0.1.0'
|
||||
|
||||
def processmsg(msg, rcpt):
|
||||
if !msg.startswith("!"):
|
||||
if msg.startswith("!"):
|
||||
return ""
|
||||
elif "youtube.com/watch" in msg:
|
||||
return msg.replace("youtube.com", "iv.datura.network")
|
||||
@ -38,9 +38,10 @@ class MUCBot(slixmpp.ClientXMPP):
|
||||
|
||||
def muc_message(self, msg):
|
||||
rcpt=msg['from'].bare
|
||||
processmsg(msg['body'], rcpt)
|
||||
if msg['mucnick'] != self.nick):
|
||||
self.send_message(mto=rcpt,mbody="%s: %s" % (msg['mucnick'],msg['body']),mtype='groupchat')
|
||||
answer = processmsg(msg['body'], rcpt)
|
||||
if msg['mucnick'] != self.nick:
|
||||
if answer is not None:
|
||||
self.send_message(mto=rcpt,mbody="%s: %s" % (msg['mucnick'],answer),mtype='groupchat')
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
@ -58,7 +59,7 @@ if __name__ == '__main__':
|
||||
JID = config.get('credentials', 'JID')
|
||||
PASSWORD = config.get('credentials', 'PASSWORD')
|
||||
NICK = config.get('credentials', 'NICK')
|
||||
ROOM1 = config.get('credentials', 'ROOM')
|
||||
ROOM = config.get('credentials', 'ROOM')
|
||||
HOST = None
|
||||
PORT = 5222
|
||||
if "host" in config.options('credentials'):
|
||||
|
Loading…
Reference in New Issue
Block a user