don't markov-learn what looks like a command
This commit is contained in:
parent
826f34e866
commit
aa71fc3232
@ -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
|
||||||
|
Loading…
x
Reference in New Issue
Block a user