mirror of
https://github.com/nonebot/nonebot2.git
synced 2024-11-24 09:05:04 +08:00
12 lines
361 B
Python
12 lines
361 B
Python
from filter import add_filter
|
|
|
|
|
|
def _log_message(ctx_msg):
|
|
print(ctx_msg.get('sender', '')
|
|
+ (('@' + ctx_msg.get('group')) if ctx_msg.get('type') == 'group_message' else '')
|
|
+ (('@' + ctx_msg.get('discuss')) if ctx_msg.get('type') == 'discuss_message' else '')
|
|
+ ': ' + ctx_msg.get('content'))
|
|
|
|
|
|
add_filter(_log_message, 1000)
|