don't markov-learn what looks like a command

This commit is contained in:
Brian S. Stephan 2018-01-17 10:31:16 -06:00
parent 826f34e866
commit aa71fc3232
1 changed files with 7 additions and 0 deletions

View File

@ -1,6 +1,8 @@
"""Observe Markov chains from Discord."""
import logging
from django.conf import settings
from bot import hitomi
from markov import lib
@ -15,6 +17,11 @@ def on_message(message):
logger.debug("markov ignoring message authored by self")
return
# ignore commands
if message.content[0] == settings.DISCORD_BOT_COMMAND_PREFIX:
logger.debug("markov ignoring message that looks like a command")
return
if message.channel.is_private:
# DMs have a context of the author
context_name = message.author