Add filter support

This commit is contained in:
Richard Chien
2016-12-08 21:58:49 +08:00
parent 7c5d7630ea
commit af431f17b1
7 changed files with 138 additions and 5 deletions

10
filters/message_logger.py Normal file
View File

@ -0,0 +1,10 @@
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('content'))
add_filter(_log_message, 1000)