asyncio.async(do_feeds(feeds))
asyncio.async(maybe_sleep())
+def mentioned_in(message, explicit = True):
+ if message.channel.is_private:
+ return True
+ if not client.user.mentioned_in(message):
+ return False
+ if explicit:
+ for member in message.mentions:
+ if member.id == client.user.id:
+ return True
+ return False
+ return True
+
@client.event
@asyncio.coroutine
def on_message(message):
if message.author.id == client.user.id:
return
log.debug('Got message from {}: {}'.format(message.author, message.content))
- if not client.user.mentioned_in(message) and not message.channel.is_private:
+ if not mentioned_in(message):
log.debug('Message is not for me!')
return
raw = re.sub('<@{}>'.format(client.user.id), '', message.content).strip()