Remove commands from muc_message handler

git-svn-id: file:///srv/svn/repo/chen/trunk@8 32723744-9b23-0b4a-b1da-9b2e968f9461
This commit is contained in:
czar 2021-05-16 22:32:03 +00:00
parent 5d6881bde4
commit 217f6c2b8c

12
main.py
View File

@ -277,19 +277,17 @@ 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)