1
0
mirror of https://github.com/MrDetonia/Maki.git synced 2024-11-10 23:53:29 -05: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" name = "Maki"
# bot version # bot version
version = "v0.15.1" version = "v0.15.2"
# 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
@ -133,10 +133,11 @@ def on_member_update(before, after):
@asyncio.coroutine @asyncio.coroutine
def on_message(message): def on_message(message):
# print messages to terminal for info # print messages to terminal for info
timestr = time.strftime('%Y-%m-%d-%H:%M:%S: ')
try: 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: 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 # do not parse own messages or private messages
if message.author != client.user and type(message.channel) is not discord.PrivateChannel: if message.author != client.user and type(message.channel) is not discord.PrivateChannel: