mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-06-27 16:04:21 +00:00
refactor: 更改使用装饰器注册命令
This commit is contained in:
@@ -3,17 +3,18 @@ from ..mgr import AbstractCommandNode, Context
|
||||
import pkg.openai.session
|
||||
import pkg.utils.context
|
||||
|
||||
|
||||
@AbstractCommandNode.register(
|
||||
parent=None,
|
||||
name='reset',
|
||||
description='重置当前会话',
|
||||
usage='!reset',
|
||||
aliases=[],
|
||||
privilege=1
|
||||
)
|
||||
class ResetCommand(AbstractCommandNode):
|
||||
parent: type = None
|
||||
|
||||
name = 'reset'
|
||||
description = '重置当前会话'
|
||||
usage = '!reset'
|
||||
aliases = []
|
||||
privilege = 1
|
||||
|
||||
@classmethod
|
||||
def process(cls, ctx: Context) -> tuple[bool, list, str]:
|
||||
def process(cls, ctx: Context) -> tuple[bool, list]:
|
||||
params = ctx.params
|
||||
session_name = ctx.session_name
|
||||
|
||||
|
||||
Reference in New Issue
Block a user