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

v0.17.2 added server id to log filenames

This commit is contained in:
Zac Herd 2016-12-01 19:53:54 +00:00
parent 4e735835df
commit 1a11d603a6

6
bot.py
View File

@ -32,7 +32,7 @@ from secret import token, lfmkey
# CONFIGURATION # CONFIGURATION
# bot version # bot version
version = "v0.17.1" version = "v0.17.2"
# text shown by .help command # text shown by .help command
helptext = """I am a Discord bot written in Python helptext = """I am a Discord bot written in Python
@ -340,10 +340,10 @@ def on_message(message):
json.dump(history, fp) json.dump(history, fp)
# log user messages for markov chains, ignoring messages with certain substrings # log user messages for markov chains, ignoring messages with certain substrings
filters = ['```', 'http://', 'https://'] filters = ['`', 'http://', 'https://']
if not any(x in message.content for x in filters): if not any(x in message.content for x in filters):
try: try:
with open('./markovs/' + message.author.id, 'a') as fp: with open('./markovs/' + message.server.id + '-' + message.author.id, 'a') as fp:
fp.write('\n' + message.content) fp.write('\n' + message.content)
except PermissionError: except PermissionError:
pass pass