mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 04:10:02 +08:00
bugfix:更换数据库初始化超时路径以修复连接超时问题 (#2137)
* bugfix:更换数据库初始化超时路径以修复连接超时问题 * 移除部分观测链路 * 细节修改 * 权限检查细节修改2 * bugfix:修复金币懒加载造成插件金币消耗不了的问题 * bugfix:整理鉴权逻辑 * 完善缓存系统 * 优化官端使用 * bugfix:增加官机和频道的前导统一剥离,新增获取群列表自愈 * bugfix:修复导入问题
This commit is contained in:
@@ -147,7 +147,7 @@ def CheckGroupId():
|
||||
@_matcher.assign("modify-level", parameterless=[CheckGroupId()])
|
||||
async def _(session: EventSession, arparma: Arparma, state: T_State, level: int):
|
||||
gid = state["group_id"]
|
||||
group, _ = await GroupConsole.get_or_create(group_id=gid)
|
||||
group, _ = await GroupConsole.get_or_create_root_group(gid)
|
||||
old_level = group.level
|
||||
group.level = level
|
||||
await group.save(update_fields=["level"])
|
||||
@@ -176,10 +176,10 @@ async def _(session: EventSession, arparma: Arparma, state: T_State):
|
||||
@_matcher.assign("auth-handle", parameterless=[CheckGroupId()])
|
||||
async def _(session: EventSession, arparma: Arparma, state: T_State):
|
||||
gid = state["group_id"]
|
||||
await GroupConsole.update_or_create(
|
||||
await GroupConsole.get_or_create_root_group(
|
||||
group_id=gid,
|
||||
channel_id__isnull=True,
|
||||
defaults={"group_flag": 0 if arparma.find("delete") else 1},
|
||||
update_defaults=True,
|
||||
)
|
||||
s = "删除" if arparma.find("delete") else "添加"
|
||||
await MessageUtils.build_message(f"{s}群认证成功!").send(reply_to=True)
|
||||
|
||||
@@ -54,6 +54,11 @@ async def _(
|
||||
arparma: Arparma,
|
||||
):
|
||||
try:
|
||||
if PlatformUtils.get_platform_scope(bot) != "qq_client":
|
||||
await MessageUtils.build_message(
|
||||
"当前平台不支持旧群组信息同步,仅 OneBot 协议端可用。"
|
||||
).send()
|
||||
return
|
||||
num = await PlatformUtils.update_group(bot)
|
||||
logger.info(
|
||||
f"更新群聊信息完成,共更新了 {num} 个群组的信息!",
|
||||
@@ -75,6 +80,11 @@ async def _(
|
||||
arparma: Arparma,
|
||||
):
|
||||
try:
|
||||
if PlatformUtils.get_platform_scope(bot) != "qq_client":
|
||||
await MessageUtils.build_message(
|
||||
"当前平台不支持旧好友信息同步,仅 OneBot 协议端可用。"
|
||||
).send()
|
||||
return
|
||||
num = await PlatformUtils.update_friend(bot)
|
||||
logger.info(
|
||||
f"更新好友信息完成,共更新了 {num} 个好友的信息!",
|
||||
|
||||
Reference in New Issue
Block a user