1
0
mirror of https://github.com/MrDetonia/Maki.git synced 2024-11-22 11:54:16 -05:00

Don't log bot commands in history, v0.7.6

This commit is contained in:
Zac Herd 2016-04-01 13:47:53 +01:00
parent 64fbb65bb1
commit c4b68c245a

14
bot.py
View File

@ -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)