1
0
mirror of https://github.com/MrDetonia/Maki.git synced 2024-11-26 04:57:18 -05:00

Randomised markov target length, v0.10.4

This commit is contained in:
Zac Herd 2016-04-03 22:19:10 +01:00
parent 05fd866342
commit 5de27f00b4

5
bot.py
View File

@ -11,6 +11,7 @@ import asyncio
import os import os
import time import time
import datetime import datetime
import random
import json import json
import markov import markov
@ -24,7 +25,7 @@ from secret import email,pwd
name = "Maki" name = "Maki"
# bot version # bot version
version = "v0.10.3" version = "v0.10.4"
# text shown by .help command # text shown by .help command
helptext = """I am a bot written in Python by MrDetonia helptext = """I am a bot written in Python by MrDetonia
@ -269,7 +270,7 @@ def on_message(message):
if os.path.isfile('./markovs/' + users[tmp]): if os.path.isfile('./markovs/' + users[tmp]):
mc = markov.Markov(open('./markovs/' + users[tmp])) mc = markov.Markov(open('./markovs/' + users[tmp]))
try: try:
response = mc.generate_text() response = mc.generate_text(random.randint(20,40))
except KeyError: except KeyError:
response = 'Something went wrong :( Maybe you haven\'t spoken enough yet?' response = 'Something went wrong :( Maybe you haven\'t spoken enough yet?'
else: else: