mirror of
https://github.com/MrDetonia/Maki.git
synced 2024-11-22 03:44:18 -05:00
more .markov malfunctioning
This commit is contained in:
parent
92e767cd88
commit
340a3822dd
6
bot.py
6
bot.py
@ -245,15 +245,15 @@ def on_message(message):
|
||||
|
||||
# if no user provided, markov the author
|
||||
if tmp == '':
|
||||
target = message.author.id
|
||||
target = message.server.id + '-' + message.author.id
|
||||
else:
|
||||
try:
|
||||
target = message.server.get_member_named(tmp).id
|
||||
target = message.server.id + '-' + message.server.get_member_named(tmp).id
|
||||
except AttributeError:
|
||||
response = "I can't find that user!"
|
||||
|
||||
if os.path.isfile('./markovs/' + target) and target != '':
|
||||
mc = markov.Markov(open('./markovs/' + message.server.id + '-' + target))
|
||||
mc = markov.Markov(open('./markovs/' + target))
|
||||
response = mc.generate_text(random.randint(20,40))
|
||||
elif target != '':
|
||||
response = "I haven't seen them speak yet!"
|
||||
|
Loading…
Reference in New Issue
Block a user