fix typos

This commit is contained in:
fram3d 2024-02-05 20:39:28 +01:00
parent 3b86c53c7c
commit c914de3358
Signed by: fram3d
GPG Key ID: 938920E709EEA32A
1 changed files with 6 additions and 5 deletions

11
chatbot
View File

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