1
0
mirror of https://github.com/MrDetonia/Maki.git synced 2024-09-21 11:11:23 -04:00

Added timestamp to stdout messages, improved display, v0.15.2

This commit is contained in:
Zac Herd 2016-05-06 09:27:52 +01:00
parent d9fef4b886
commit 0f4b5100d9

7
bot.py
View File

@ -31,7 +31,7 @@ from secret import token
name = "Maki"
# bot version
version = "v0.15.1"
version = "v0.15.2"
# text shown by .help command
helptext = """I am a bot written in Python by MrDetonia
@ -133,10 +133,11 @@ def on_member_update(before, after):
@asyncio.coroutine
def on_message(message):
# print messages to terminal for info
timestr = time.strftime('%Y-%m-%d-%H:%M:%S: ')
try:
print(message.server.name + '-' + message.channel.name + '-' + message.author.name + ': ' + message.content)
print(timestr + message.server.name + ' ' + message.channel.name + ' ' + message.author.name + ': ' + message.content)
except AttributeError:
print('PRIV-' + message.author.name + ': ' + message.content)
print(timestr + 'PRIV ' + message.author.name + ': ' + message.content)
# do not parse own messages or private messages
if message.author != client.user and type(message.channel) is not discord.PrivateChannel: