mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 14:22:55 +08:00
🐛 修复群白名单和认证无法删除
This commit is contained in:
parent
910542f2b5
commit
35699f86e3
@ -25,13 +25,13 @@
|
||||
@font-face {
|
||||
font-family: rxxxtFont;
|
||||
/* 导入的字体文件 */
|
||||
src: url("./res/font/日系小熊可爱体 Regular.ttf");
|
||||
src: url("./res/font/rxxxkat.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
font-family: kcytFont;
|
||||
/* 导入的字体文件 */
|
||||
src: url("./res/font/江城圆体 700W.ttf");
|
||||
src: url("./res/font/jcyt.ttf");
|
||||
}
|
||||
|
||||
@font-face {
|
||||
|
||||
Binary file not shown.
@ -60,18 +60,17 @@ __plugin_meta__ = PluginMetadata(
|
||||
_matcher = on_alconna(
|
||||
Alconna(
|
||||
"group-manage",
|
||||
Option("--delete", action=store_true, help_text="删除"),
|
||||
Subcommand(
|
||||
"modify-level", Args["level", int]["group_id?", int], help_text="修改群权限"
|
||||
),
|
||||
Subcommand(
|
||||
"super-handle",
|
||||
Option("--del", action=store_true, help_text="删除"),
|
||||
Args["group_id", int],
|
||||
help_text="添加/删除群白名单",
|
||||
),
|
||||
Subcommand(
|
||||
"auth-handle",
|
||||
Option("--del", action=store_true, help_text="删除"),
|
||||
Args["group_id", int],
|
||||
help_text="添加/删除群认证",
|
||||
),
|
||||
@ -99,7 +98,7 @@ _matcher.shortcut(
|
||||
_matcher.shortcut(
|
||||
"删除群白名单",
|
||||
command="group-manage",
|
||||
arguments=["super-handle", "{%0}", "--del"],
|
||||
arguments=["super-handle", "{%0}", "--delete"],
|
||||
prefix=True,
|
||||
)
|
||||
|
||||
@ -113,7 +112,7 @@ _matcher.shortcut(
|
||||
_matcher.shortcut(
|
||||
"删除群认证",
|
||||
command="group-manage",
|
||||
arguments=["auth-handle", "{%0}", "--del"],
|
||||
arguments=["auth-handle", "{%0}", "--delete"],
|
||||
prefix=True,
|
||||
)
|
||||
|
||||
@ -167,8 +166,8 @@ async def _(session: EventSession, arparma: Arparma, state: T_State):
|
||||
group = await GroupConsole.get_or_none(group_id=gid)
|
||||
if not group:
|
||||
await MessageUtils.build_message("群组信息不存在, 请更新群组信息...").finish()
|
||||
s = "删除" if arparma.find("del") else "添加"
|
||||
group.is_super = not arparma.find("del")
|
||||
s = "删除" if arparma.find("delete") else "添加"
|
||||
group.is_super = not arparma.find("delete")
|
||||
await group.save(update_fields=["is_super"])
|
||||
await MessageUtils.build_message(f"{s}群白名单成功!").send(reply_to=True)
|
||||
logger.info(f"{s}群白名单", arparma.header_result, session=session, target=gid)
|
||||
@ -178,9 +177,9 @@ async def _(session: EventSession, arparma: Arparma, state: T_State):
|
||||
async def _(session: EventSession, arparma: Arparma, state: T_State):
|
||||
gid = state["group_id"]
|
||||
await GroupConsole.update_or_create(
|
||||
group_id=gid, defaults={"group_flag": 0 if arparma.find("del") else 1}
|
||||
group_id=gid, defaults={"group_flag": 0 if arparma.find("delete") else 1}
|
||||
)
|
||||
s = "删除" if arparma.find("del") else "添加"
|
||||
s = "删除" if arparma.find("delete") else "添加"
|
||||
await MessageUtils.build_message(f"{s}群认证成功!").send(reply_to=True)
|
||||
logger.info(f"{s}群白名单", arparma.header_result, session=session, target=gid)
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user