mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 08:41:29 +00:00
Add mojo_weixin adapter
This commit is contained in:
10
filters/allow_only_message_10000.py
Normal file
10
filters/allow_only_message_10000.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""
|
||||
This filter intercepts all post data except ones of which 'post_type' is 'message'.
|
||||
"""
|
||||
|
||||
from filter import as_filter
|
||||
|
||||
|
||||
@as_filter(priority=10000)
|
||||
def _filter(ctx_msg):
|
||||
return ctx_msg.get('post_type') == 'message'
|
10
filters/intercept_massive_platform_100.py
Normal file
10
filters/intercept_massive_platform_100.py
Normal file
@ -0,0 +1,10 @@
|
||||
"""
|
||||
This filter intercepts messages that are from massive platforms.
|
||||
"""
|
||||
|
||||
from filter import as_filter
|
||||
|
||||
|
||||
@as_filter(priority=100)
|
||||
def _filter(ctx_msg):
|
||||
return not ctx_msg.get('is_massive_platform', False)
|
Reference in New Issue
Block a user