The bot only answers to contact it received presence from and to groupchat messages.
body = msg['body'].strip()
if not body.startswith(MUCBot.prefix):
return
- if msg['from'] not in self.__seen:
- self.log.warning('Will not handle message from unseen jid: %s', msg['from'])
- #return
+ self.log.debug(msg['from'])
+ if msg['from'] not in self.__seen and msg['type'] == 'chat':
+ self.log.warning('Will not handle direct message'
+ 'from unseen jid: %s', msg['from'])
+ return
args = body[1:].split()
cmd = args.pop(0)
if cmd not in self.commands: