mirror of
https://github.com/nonebot/nonebot2.git
synced 2025-07-28 08:41:29 +00:00
Add some commands
This commit is contained in:
@ -74,6 +74,8 @@ def _dispatch_command(ctx_msg):
|
||||
# Starting a new command, so remove any previous command session
|
||||
interactive.remove_session(source)
|
||||
|
||||
command[0] = command[0].lower()
|
||||
ctx_msg['command'] = command[0]
|
||||
cmdhub.call(command[0], command[1], ctx_msg)
|
||||
except SkipException:
|
||||
# Skip this message
|
||||
|
15
filters/how_to_use.py
Normal file
15
filters/how_to_use.py
Normal file
@ -0,0 +1,15 @@
|
||||
from filter import add_filter
|
||||
from commands import core
|
||||
|
||||
|
||||
def _print_help_message(ctx_msg):
|
||||
a = ['help', '怎么用', '怎么用啊', '你好', '你好啊', '帮助',
|
||||
'用法', '使用帮助', '使用指南', '使用说明', '使用方法',
|
||||
'你能做什么', '你能做些什么', '你会做什么', '你会做些什么']
|
||||
if ctx_msg.get('content', '') in a:
|
||||
core.help('', ctx_msg)
|
||||
return False
|
||||
return True
|
||||
|
||||
|
||||
add_filter(_print_help_message, priority=1)
|
Reference in New Issue
Block a user