Remove commands from muc_message handler

This commit is contained in:
Czar 2021-05-16 19:32:03 -03:00
commit 75422e885a
Signed by: czar
GPG key ID: 2DBA9558E9277C37

14
main.py
View file

@ -277,20 +277,18 @@ class AngelBot(ClientXMPP):
if msg["mucnick"] == self.nick:
return
ctx = msg["body"].strip().split()
edit = "urn:xmpp:message-correct:0" in str(msg)
if edit:
return
try:
if not msg["oob"]["url"]:
if urls := self.get_urls(msg):
await self.parse_urls(msg, urls, sender, mtype)
except Exception:
pass
edit = "urn:xmpp:message-correct:0" in str(msg)
cm = ctx.pop(0)
if cm in self.muc_commands:
if not edit:
self.muc_commands[cm](msg, ctx, sender)
else:
self.s(msg, sender, mtype)
self.s(msg, sender, mtype)
if __name__ == "__main__":