mirror of
https://github.com/MrDetonia/Maki.git
synced 2024-11-25 12:40:46 -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 no user provided, markov the author
|
||||||
if tmp == '':
|
if tmp == '':
|
||||||
target = message.author.id
|
target = message.server.id + '-' + message.author.id
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
target = message.server.get_member_named(tmp).id
|
target = message.server.id + '-' + message.server.get_member_named(tmp).id
|
||||||
except AttributeError:
|
except AttributeError:
|
||||||
response = "I can't find that user!"
|
response = "I can't find that user!"
|
||||||
|
|
||||||
if os.path.isfile('./markovs/' + target) and target != '':
|
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))
|
response = mc.generate_text(random.randint(20,40))
|
||||||
elif target != '':
|
elif target != '':
|
||||||
response = "I haven't seen them speak yet!"
|
response = "I haven't seen them speak yet!"
|
||||||
|
Loading…
Reference in New Issue
Block a user