🐛: 取消QQSDK的旧版标记

🐛: 修复switch指令的一些问题
This commit is contained in:
Soulter
2023-11-18 15:09:22 +08:00
parent fb0b626813
commit ad9705f9c4
4 changed files with 28 additions and 25 deletions

View File

@@ -1,13 +1,12 @@
import json
from util import general_utils as gu
has_git = True
try:
import git.exc
from git.repo import Repo
except BaseException as e:
print("你正运行在无Git环境下暂时将无法使用插件、热更新功能。")
gu.log("你正运行在无Git环境下暂时将无法使用插件、热更新功能。")
has_git = False
import os
import sys
import requests
@@ -16,7 +15,6 @@ import json
import util.plugin_util as putil
import shutil
import importlib
from util import general_utils as gu
from util.cmd_config import CmdConfig as cc
from model.platform.qq import QQ
import stat

View File

@@ -174,11 +174,13 @@ class CommandOpenAIOfficial(Command):
if index > len(key_stat) or index < 1:
return True, "账号序号不合法。", "switch"
else:
ret = self.provider.check_key(list(key_stat.keys())[index-1])
if ret:
return True, f"账号切换成功。", "switch"
else:
return True, f"账号切换失败,可能超额或超频。", "switch"
try:
new_key = list(key_stat.keys())[index-1]
ret = self.provider.check_key(new_key)
self.provider.set_key(new_key)
except BaseException as e:
return True, "账号切换失败,原因: " + str(e), "switch"
return True, f"账号切换成功。", "switch"
except BaseException as e:
return True, "未知错误: "+str(e), "switch"
else: