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

No longer logs messages containing web links, changed how logging filters work, v0.10.5

This commit is contained in:
Zac Herd 2016-04-04 09:38:24 +01:00
parent 5de27f00b4
commit 98b2076730

7
bot.py
View File

@ -25,7 +25,7 @@ from secret import email,pwd
name = "Maki" name = "Maki"
# bot version # bot version
version = "v0.10.4" version = "v0.10.5"
# 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
@ -283,8 +283,9 @@ def on_message(message):
with open('hist.json', 'w') as fp: with open('hist.json', 'w') as fp:
json.dump(history, fp) json.dump(history, fp)
# log user messages for markov chains # log user messages for markov chains, ignoring messages with certain substrings
if '```' not in message.content: filters = ['```', 'http://', 'https://']
if not any(x in message.content for x in filters):
with open('./markovs/' + message.author.id, 'a') as fp: with open('./markovs/' + message.author.id, 'a') as fp:
fp.write('\n' + message.content) fp.write('\n' + message.content)