feat: switch command entities to sdk

This commit is contained in:
Junyan Qin
2025-07-10 10:51:36 +08:00
parent 5b044a1917
commit 10a44c70b6
22 changed files with 169 additions and 210 deletions
+6 -3
View File
@@ -2,10 +2,13 @@ from __future__ import annotations
import typing
from .. import operator, entities
from .. import operator
from langbot_plugin.api.entities.builtin.command import context as command_context
@operator.operator_class(name='update', help='更新程序', usage='!update', privilege=2)
class UpdateCommand(operator.CommandOperator):
async def execute(self, context: entities.ExecuteContext) -> typing.AsyncGenerator[entities.CommandReturn, None]:
yield entities.CommandReturn(text='不再支持通过命令更新,请查看 LangBot 文档。')
async def execute(
self, context: command_context.ExecuteContext
) -> typing.AsyncGenerator[command_context.CommandReturn, None]:
yield command_context.CommandReturn(text='不再支持通过命令更新,请查看 LangBot 文档。')