1
0
mirror of https://github.com/MrDetonia/Maki.git synced 2024-11-10 23:53:29 -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"
# bot version
version = "v0.10.4"
version = "v0.10.5"
# text shown by .help command
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:
json.dump(history, fp)
# log user messages for markov chains
if '```' not in message.content:
# log user messages for markov chains, ignoring messages with certain substrings
filters = ['```', 'http://', 'https://']
if not any(x in message.content for x in filters):
with open('./markovs/' + message.author.id, 'a') as fp:
fp.write('\n' + message.content)