mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-06 04:10:02 +08:00
🐛 修复添加插件依赖更新 (#1837)
* 🐛 修复添加插件依赖更新 * 🔧 修改插件依赖安装命令为使用poetry运行pip * 🐛 修复群组入群与退群提示 * 🐛 修复群组踢出用户提醒 * 🎨 代码优化 * 🎨 群欢迎迁移优化 * 🩹 精确webui调用统计 * 🚨 auto fix by pre-commit hooks * 🐛 修复测试 * 🎨 fix pre-commit.ci * 🎨 fix pre-commit.ci --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
This commit is contained in:
co-authored by
pre-commit-ci[bot]
parent
d6fd5f170a
commit
4ed1791b30
+25
-25
@@ -55,6 +55,8 @@ class PlatformUtils:
|
||||
"""
|
||||
if isinstance(session, Bot):
|
||||
return bool(BotConfig.get_qbot_uid(session.self_id))
|
||||
if BotConfig.get_qbot_uid(session.self_id):
|
||||
return True
|
||||
return session.scope == SupportScope.qq_api
|
||||
|
||||
@classmethod
|
||||
@@ -354,32 +356,30 @@ class PlatformUtils:
|
||||
返回:
|
||||
tuple[list[GroupConsole], str]: 群组列表, 平台
|
||||
"""
|
||||
if interface := get_interface(bot):
|
||||
platform = cls.get_platform(bot)
|
||||
result_list = []
|
||||
scenes = await interface.get_scenes(SceneType.GROUP)
|
||||
for scene in scenes:
|
||||
group_id = scene.id
|
||||
result_list.append(
|
||||
GroupConsole(
|
||||
group_id=scene.id,
|
||||
group_name=scene.name,
|
||||
)
|
||||
if not (interface := get_interface(bot)):
|
||||
return [], ""
|
||||
platform = cls.get_platform(bot)
|
||||
result_list = []
|
||||
scenes = await interface.get_scenes(SceneType.GROUP)
|
||||
for scene in scenes:
|
||||
group_id = scene.id
|
||||
result_list.append(
|
||||
GroupConsole(
|
||||
group_id=scene.id,
|
||||
group_name=scene.name,
|
||||
)
|
||||
if not only_group and platform != "qq":
|
||||
if channel_list := await interface.get_scenes(
|
||||
parent_scene_id=group_id
|
||||
):
|
||||
for channel in channel_list:
|
||||
result_list.append(
|
||||
GroupConsole(
|
||||
group_id=scene.id,
|
||||
group_name=channel.name,
|
||||
channel_id=channel.id,
|
||||
)
|
||||
)
|
||||
return result_list, platform
|
||||
return [], ""
|
||||
)
|
||||
if not only_group and platform != "qq":
|
||||
if channel_list := await interface.get_scenes(parent_scene_id=group_id):
|
||||
result_list.extend(
|
||||
GroupConsole(
|
||||
group_id=scene.id,
|
||||
group_name=channel.name,
|
||||
channel_id=channel.id,
|
||||
)
|
||||
for channel in channel_list
|
||||
)
|
||||
return result_list, platform
|
||||
|
||||
@classmethod
|
||||
async def update_friend(cls, bot: Bot) -> int:
|
||||
|
||||
Reference in New Issue
Block a user