mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-27 16:21:28 +00:00
Add lots of comments and logs
This commit is contained in:
@ -76,9 +76,19 @@ async def handle_notice_or_request(bot: NoneBot, ctx: Dict[str, Any]) -> None:
|
||||
event += f'.{ctx["sub_type"]}'
|
||||
|
||||
if post_type == 'notice':
|
||||
_log_notice(ctx)
|
||||
session = NoticeSession(bot, ctx)
|
||||
else: # must be 'request'
|
||||
_log_request(ctx)
|
||||
session = RequestSession(bot, ctx)
|
||||
|
||||
logger.debug(f'Emitting event: {event}')
|
||||
await _bus.emit(event, session)
|
||||
|
||||
|
||||
def _log_notice(ctx: Dict[str, Any]) -> None:
|
||||
logger.info(f'Notice: {ctx}')
|
||||
|
||||
|
||||
def _log_request(ctx: Dict[str, Any]) -> None:
|
||||
logger.info(f'Request: {ctx}')
|
||||
|
Reference in New Issue
Block a user