mirror of
https://github.com/langbot-app/LangBot.git
synced 2025-11-25 19:37:36 +08:00
27 lines
731 B
Python
27 lines
731 B
Python
from .. import aamgr
|
|
|
|
|
|
@aamgr.AbstractCommandNode.register(
|
|
parent=None,
|
|
name="version",
|
|
description="查看版本信息",
|
|
usage="!version",
|
|
aliases=[],
|
|
privilege=1
|
|
)
|
|
class VersionCommand(aamgr.AbstractCommandNode):
|
|
@classmethod
|
|
def process(cls, ctx: aamgr.Context) -> tuple[bool, list]:
|
|
reply = []
|
|
import pkg.utils.updater
|
|
|
|
reply_str = "[bot]当前版本:\n{}\n".format(pkg.utils.updater.get_current_version_info())
|
|
try:
|
|
if pkg.utils.updater.is_new_version_available():
|
|
reply_str += "\n有新版本可用,请使用命令 !update 进行更新"
|
|
except:
|
|
pass
|
|
|
|
reply = [reply_str]
|
|
|
|
return True, reply |