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

View File

@ -1,6 +1,8 @@
"""Observe Markov chains from Discord.""" """Observe Markov chains from Discord."""
import logging import logging
from django.conf import settings
from bot import hitomi from bot import hitomi
from markov import lib from markov import lib
@ -15,6 +17,11 @@ def on_message(message):
logger.debug("markov ignoring message authored by self") logger.debug("markov ignoring message authored by self")
return 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: if message.channel.is_private:
# DMs have a context of the author # DMs have a context of the author
context_name = message.author context_name = message.author