From c4b68c245aaf779bc02f425c8712307ba0d00e52 Mon Sep 17 00:00:00 2001 From: Zac Herd Date: Fri, 1 Apr 2016 13:47:53 +0100 Subject: [PATCH] Don't log bot commands in history, v0.7.6 --- bot.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/bot.py b/bot.py index e880f14..c9ea910 100644 --- a/bot.py +++ b/bot.py @@ -23,7 +23,7 @@ from secret import email,pwd name = "Maki" # bot version -version = "v0.7.5" +version = "v0.7.6" # text shown by .help command helptext = """I am a bot written in Python by MrDetonia @@ -175,8 +175,14 @@ def on_message(message): # echo message yield from client.send_message(message.channel, message.content[5:]) + else: + # log each message against users + history[message.author.name] = (message.content, time.time()) + with open('hist.json', 'w') as fp: + json.dump(history, fp) + # Ben meme trackers - elif '/ck/' in message.content and message.author.name == "Ben.H": + if '/ck/' in message.content and message.author.name == "Ben.H": bentrack['ck'] += 1 yield from client.send_message(message.channel, 'I have seen Ben reference /ck/ ' + bentrack['ck'] + ' times now.') # save count @@ -190,10 +196,6 @@ def on_message(message): with open('bentrack.json', 'w') as fp: json.dump(bentrack, fp) - # log each message against users - history[message.author.name] = (message.content, time.time()) - with open('hist.json', 'w') as fp: - json.dump(history, fp) # Run the client client.run(email, pwd)