Log self_id while receiving messages

This commit is contained in:
Richard Chien 2019-01-05 22:41:15 +08:00
parent 99fd832441
commit 06553c454b

View File

@ -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"]}')