chore: Hello LangBot !

This commit is contained in:
Junyan Qin
2024-11-16 17:57:39 +08:00
parent 491d977d9e
commit 9fc891ec01
14 changed files with 25 additions and 31 deletions
+2 -2
View File
@@ -545,7 +545,7 @@ class Image(MessageComponent):
@pydantic.validator('path')
def validate_path(cls, path: typing.Union[str, Path, None]):
"""修复 path 参数的行为,使之相对于 QChatGPT 的启动路径。"""
"""修复 path 参数的行为,使之相对于 LangBot 的启动路径。"""
if path:
try:
return str(Path(path).resolve(strict=True))
@@ -673,7 +673,7 @@ class Voice(MessageComponent):
"""语音的长度,单位为秒。"""
@pydantic.validator('path')
def validate_path(cls, path: typing.Optional[str]):
"""修复 path 参数的行为,使之相对于 QChatGPT 的启动路径。"""
"""修复 path 参数的行为,使之相对于 LangBot 的启动路径。"""
if path:
try:
return str(Path(path).resolve(strict=True))
+2 -2
View File
@@ -103,7 +103,7 @@ class BasePlugin(metaclass=abc.ABCMeta):
class APIHost:
"""QChatGPT API 宿主"""
"""LangBot API 宿主"""
ap: app.Application
@@ -136,7 +136,7 @@ class APIHost:
if self.ap.ver_mgr.compare_version_str(qchatgpt_version, ge) < 0 or \
(self.ap.ver_mgr.compare_version_str(qchatgpt_version, le) > 0):
raise Exception("QChatGPT 版本不满足要求,某些功能(可能是由插件提供的)无法正常使用。(要求版本:{}-{},但当前版本:{}".format(ge, le, qchatgpt_version))
raise Exception("LangBot 版本不满足要求,某些功能(可能是由插件提供的)无法正常使用。(要求版本:{}-{},但当前版本:{}".format(ge, le, qchatgpt_version))
return True
+1 -1
View File
@@ -48,7 +48,7 @@ class AnnouncementManager:
) -> list[Announcement]:
"""获取所有公告"""
resp = requests.get(
url="https://api.github.com/repos/RockChinQ/QChatGPT/contents/res/announcement.json",
url="https://api.github.com/repos/RockChinQ/LangBot/contents/res/announcement.json",
proxies=self.ap.proxy_mgr.get_forward_proxies(),
timeout=5
)
+1 -1
View File
@@ -38,7 +38,7 @@ class VersionManager:
async def get_release_list(self) -> list:
"""获取发行列表"""
rls_list_resp = requests.get(
url="https://api.github.com/repos/RockChinQ/QChatGPT/releases",
url="https://api.github.com/repos/RockChinQ/LangBot/releases",
proxies=self.ap.proxy_mgr.get_forward_proxies(),
timeout=5
)