Add some commands

This commit is contained in:
Richard Chien
2016-12-30 22:01:50 +08:00
parent e14b74cf2f
commit c62fafa69e
15 changed files with 407 additions and 46 deletions

View File

@ -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
View 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)