Only pass messages when summoned

This commit is contained in:
Luke Murphy 2021-01-16 13:17:55 +01:00
parent ad3d77f5e1
commit 27f202de37
No known key found for this signature in database
GPG Key ID: 5E2EF5A63E3718CC
1 changed files with 4 additions and 2 deletions

View File

@ -265,6 +265,9 @@ class Bot(ClientXMPP):
if message["mucnick"] == self.config.nick:
return
if self.nick not in message["body"]:
return
_message = SimpleMessage(message)
if self.nick in _message.body and "@" in _message.body:
@ -357,8 +360,7 @@ class EchoBot(Bot):
def group(self, message):
"""Send back whatever receive in group chats."""
if "echobot" in message.body:
self.reply(message.body.split(":")[-1], room=message.room)
self.reply(message.body.split(":")[-1], room=message.room)
class WhisperBot(Bot):