From 5de27f00b4ebc722530e760f604af534efd4a195 Mon Sep 17 00:00:00 2001 From: Zac Herd Date: Sun, 3 Apr 2016 22:19:10 +0100 Subject: [PATCH] Randomised markov target length, v0.10.4 --- bot.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/bot.py b/bot.py index f7d47e7..1ab18e0 100644 --- a/bot.py +++ b/bot.py @@ -11,6 +11,7 @@ import asyncio import os import time import datetime +import random import json import markov @@ -24,7 +25,7 @@ from secret import email,pwd name = "Maki" # bot version -version = "v0.10.3" +version = "v0.10.4" # text shown by .help command 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]): mc = markov.Markov(open('./markovs/' + users[tmp])) try: - response = mc.generate_text() + response = mc.generate_text(random.randint(20,40)) except KeyError: response = 'Something went wrong :( Maybe you haven\'t spoken enough yet?' else: