From 06553c454b04fb84d1c438134672715b0adeb5a1 Mon Sep 17 00:00:00 2001 From: Richard Chien Date: Sat, 5 Jan 2019 22:41:15 +0800 Subject: [PATCH] Log self_id while receiving messages --- nonebot/message.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nonebot/message.py b/nonebot/message.py index d9cabcd9..f5c10afa 100644 --- a/nonebot/message.py +++ b/nonebot/message.py @@ -59,10 +59,11 @@ async def handle_message(bot: NoneBot, ctx: Context_T) -> None: def _log_message(ctx: Context_T) -> None: - msg_from = f'{ctx["user_id"]}' + msg_from = str(ctx['user_id']) if ctx['message_type'] == 'group': msg_from += f'@[群:{ctx["group_id"]}]' elif ctx['message_type'] == 'discuss': msg_from += f'@[讨论组:{ctx["discuss_id"]}]' - logger.info(f'Message {ctx["message_id"]} from {msg_from}: ' + logger.info(f'Self: {ctx["self_id"]}, ' + f'Message {ctx["message_id"]} from {msg_from}: ' f'{ctx["message"]}')