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

Fixed incorrect JSON being loaded for welcomes, fixed .seen picking up itself, v0.6.1

This commit is contained in:
Zac Herd 2016-03-31 00:38:14 +01:00
parent 387a473bd6
commit 6c566263c0

14
bot.py
View File

@ -24,7 +24,7 @@ from secret import email,pwd
name = "Maki" name = "Maki"
# bot version # bot version
version = "v0.6.0" version = "v0.6.1"
# 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
@ -62,7 +62,7 @@ if os.path.isfile('hist.json'):
# user welcome messages # user welcome messages
welcomes = {'test': 'test'} welcomes = {'test': 'test'}
if os.path.isfile('welcomes.json'): if os.path.isfile('welcomes.json'):
with open('hist.json', 'r') as fp: with open('welcomes.json', 'r') as fp:
welcomes = json.load(fp) welcomes = json.load(fp)
# this instance of a Discord client # this instance of a Discord client
@ -116,11 +116,6 @@ def on_message(message):
# do not parse own messages # do not parse own messages
if message.author != client.user: if message.author != client.user:
# log each message against users
history[message.author.name] = (message.content, time.time())
with open('hist.json', 'w') as fp:
json.dump(history, fp)
# parse messages for commands # parse messages for commands
if message.content.startswith('.bots'): if message.content.startswith('.bots'):
# print bot info # print bot info
@ -184,5 +179,10 @@ def on_message(message):
with open('bentrack.json', 'w') as fp: with open('bentrack.json', 'w') as fp:
json.dump(bentrack, 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 # Run the client
client.run(email, pwd) client.run(email, pwd)