mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2025-12-15 06:12:53 +08:00
🐛 修改禁用module (#1688)
* 🐛 修改禁用module
* chore(version): Update version to v0.2.3-4cde662
---------
Co-authored-by: HibiKier <HibiKier@users.noreply.github.com>
This commit is contained in:
parent
5f92efa658
commit
2f459719e8
@ -1 +1 @@
|
||||
__version__: v0.2.3-ba3a9f1
|
||||
__version__: v0.2.3-4cde662
|
||||
|
||||
@ -53,6 +53,7 @@ async def _():
|
||||
_group, _ = await GroupConsole.get_or_create(
|
||||
group_id=group.group_id, channel_id__isnull=True
|
||||
)
|
||||
modules = [f"<{module}" for module in modules]
|
||||
_group.block_task = ",".join(modules) + "," # type: ignore
|
||||
update_list.append(_group)
|
||||
logger.info(
|
||||
|
||||
@ -71,19 +71,19 @@ async def _():
|
||||
for group in await GroupConsole.all():
|
||||
if group.block_plugin:
|
||||
if modules := group.block_plugin.split(","):
|
||||
if block_plugin := [
|
||||
f"<{module}" for module in modules if not module.startswith("<")
|
||||
]:
|
||||
group.block_plugin = (",".join(block_plugin) + ",").replace(
|
||||
"<,", ""
|
||||
)
|
||||
block_plugin = "".join(
|
||||
(f"{module}," if module.startswith("<") else f"<{module},")
|
||||
for module in modules
|
||||
if module.strip()
|
||||
)
|
||||
group.block_plugin = block_plugin.replace("<,", "")
|
||||
if group.block_task:
|
||||
if modules := group.block_task.split(","):
|
||||
if block_task := [
|
||||
f"<{module}" for module in modules if not module.startswith("<")
|
||||
]:
|
||||
group.block_task = (",".join(block_task) + ",").replace(
|
||||
"<,", ""
|
||||
)
|
||||
block_task = "".join(
|
||||
(f"{module}," if module.startswith("<") else f"<{module},")
|
||||
for module in modules
|
||||
if module.strip()
|
||||
)
|
||||
group.block_task = block_task.replace("<,", "")
|
||||
data_list.append(group)
|
||||
await GroupConsole.bulk_update(data_list, ["block_plugin", "block_task"], 10)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user