mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 11:42:44 +08:00
feat: 添加指令抽象类
This commit is contained in:
parent
5dae777e79
commit
36dca7ae2f
0
pkg/qqbot/cmds/__init__.py
Normal file
0
pkg/qqbot/cmds/__init__.py
Normal file
18
pkg/qqbot/cmds/model.py
Normal file
18
pkg/qqbot/cmds/model.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
# 指令模型
|
||||
|
||||
commands = {}
|
||||
"""已注册的指令类"""
|
||||
|
||||
|
||||
class AbsCommand:
|
||||
"""指令抽象类"""
|
||||
@staticmethod
|
||||
def execute(cls, cmd: str, params: list, session_name: str, text_message: str, launcher_type: str, launcher_id: int,
|
||||
sender_id: int, is_admin: bool) -> list:
|
||||
raise NotImplementedError
|
||||
|
||||
|
||||
def register(cls: type):
|
||||
"""注册指令类"""
|
||||
commands[cls.name] = cls
|
||||
return cls
|
Loading…
Reference in New Issue
Block a user