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
8adff43113
commit
940514b16b
@ -299,6 +299,7 @@ PS: **ARM平台** 请使用全量版 同时 **如果你的机器 RAM < 1G 可能
|
|||||||
### 2022/12/11
|
### 2022/12/11
|
||||||
|
|
||||||
* 词条问题支持真寻的昵称开头与at真寻开头并优化回复
|
* 词条问题支持真寻的昵称开头与at真寻开头并优化回复
|
||||||
|
* 更正私聊时功能管理回复错误
|
||||||
* 添加统计表
|
* 添加统计表
|
||||||
|
|
||||||
### 2022/12/10
|
### 2022/12/10
|
||||||
|
|||||||
@ -88,7 +88,7 @@ async def custom_group_welcome(
|
|||||||
task_data = None
|
task_data = None
|
||||||
|
|
||||||
|
|
||||||
async def change_group_switch(cmd: str, group_id: int, is_super: bool = False):
|
async def change_group_switch(cmd: str, group_id: int, is_super: bool = False) -> str:
|
||||||
"""
|
"""
|
||||||
说明:
|
说明:
|
||||||
修改群功能状态
|
修改群功能状态
|
||||||
|
|||||||
@ -85,7 +85,7 @@ async def _(bot: Bot, event: MessageEvent):
|
|||||||
"group_name"
|
"group_name"
|
||||||
]
|
]
|
||||||
await switch_rule_matcher.send(
|
await switch_rule_matcher.send(
|
||||||
f"已禁用群聊 {group_name}({block_type}) 的 {_cmd[2:]} 功能"
|
f"已{_cmd[:2]}群聊 {group_name}({block_type}) 的 {_cmd[2:]} 功能"
|
||||||
)
|
)
|
||||||
elif block_type in ["all", "private", "group", "a", "p", "g"]:
|
elif block_type in ["all", "private", "group", "a", "p", "g"]:
|
||||||
block_type = "all" if block_type == "a" else block_type
|
block_type = "all" if block_type == "a" else block_type
|
||||||
|
|||||||
@ -136,7 +136,12 @@ class HelpImageBuild:
|
|||||||
self._sort_data[plugin_data.menu_type[0]].append(self._data[key])
|
self._sort_data[plugin_data.menu_type[0]].append(self._data[key])
|
||||||
|
|
||||||
async def build_name_image(
|
async def build_name_image(
|
||||||
self, max_width: int, name: str, color: str, text_color: Tuple[int, int, int], pos: Optional[Tuple[int, int, int, int]]
|
self,
|
||||||
|
max_width: int,
|
||||||
|
name: str,
|
||||||
|
color: str,
|
||||||
|
text_color: Tuple[int, int, int],
|
||||||
|
pos: Optional[Tuple[int, int, int, int]],
|
||||||
) -> BuildImage:
|
) -> BuildImage:
|
||||||
image = BuildImage(max_width - 5, 50, color=color, font_size=24)
|
image = BuildImage(max_width - 5, 50, color=color, font_size=24)
|
||||||
await image.acircle_corner()
|
await image.acircle_corner()
|
||||||
@ -160,7 +165,7 @@ class HelpImageBuild:
|
|||||||
wh_list = [_image.getsize(x.name) for x in plugin_list]
|
wh_list = [_image.getsize(x.name) for x in plugin_list]
|
||||||
wh_list.append(_image.getsize(menu_type))
|
wh_list.append(_image.getsize(menu_type))
|
||||||
# sum_height = sum([x[1] for x in wh_list])
|
# sum_height = sum([x[1] for x in wh_list])
|
||||||
if build_type == 'VV':
|
if build_type == "VV":
|
||||||
sum_height = 50 * len(plugin_list) + 10
|
sum_height = 50 * len(plugin_list) + 10
|
||||||
else:
|
else:
|
||||||
sum_height = (font_size + 6) * len(plugin_list) + 10
|
sum_height = (font_size + 6) * len(plugin_list) + 10
|
||||||
@ -192,7 +197,7 @@ class HelpImageBuild:
|
|||||||
if (
|
if (
|
||||||
not plugin_data.plugin_status.status
|
not plugin_data.plugin_status.status
|
||||||
and plugin_data.plugin_status.block_type in ["group", "all"]
|
and plugin_data.plugin_status.block_type in ["group", "all"]
|
||||||
):
|
) or not group_manager.get_plugin_super_status(plugin_data.model, group_id):
|
||||||
w = curr_h + int(B.getsize(plugin_data.name)[1] / 2) + 2
|
w = curr_h + int(B.getsize(plugin_data.name)[1] / 2) + 2
|
||||||
pos = (
|
pos = (
|
||||||
7,
|
7,
|
||||||
@ -201,8 +206,16 @@ class HelpImageBuild:
|
|||||||
w,
|
w,
|
||||||
)
|
)
|
||||||
if build_type == "VV":
|
if build_type == "VV":
|
||||||
name_image = await self.build_name_image(max_width, plugin_data.name, "black" if not idx % 2 else "white", text_color, pos)
|
name_image = await self.build_name_image(
|
||||||
await B.apaste(name_image, (0, curr_h), True, center_type="by_width")
|
max_width,
|
||||||
|
plugin_data.name,
|
||||||
|
"black" if not idx % 2 else "white",
|
||||||
|
text_color,
|
||||||
|
pos,
|
||||||
|
)
|
||||||
|
await B.apaste(
|
||||||
|
name_image, (0, curr_h), True, center_type="by_width"
|
||||||
|
)
|
||||||
curr_h += name_image.h + 5
|
curr_h += name_image.h + 5
|
||||||
else:
|
else:
|
||||||
await B.atext(
|
await B.atext(
|
||||||
|
|||||||
@ -142,6 +142,16 @@ class GroupManager(StaticData):
|
|||||||
"""
|
"""
|
||||||
return module not in self._data.group_manager[str(group_id)].close_plugins
|
return module not in self._data.group_manager[str(group_id)].close_plugins
|
||||||
|
|
||||||
|
def get_plugin_super_status(self, module: str, group_id: int) -> bool:
|
||||||
|
"""
|
||||||
|
说明:
|
||||||
|
获取插件是否被超级用户关闭
|
||||||
|
参数:
|
||||||
|
:param module: 功能模块名
|
||||||
|
:param group_id: 群组
|
||||||
|
"""
|
||||||
|
return f"{module}:super" not in self._data.group_manager[str(group_id)].close_plugins
|
||||||
|
|
||||||
@init_group
|
@init_group
|
||||||
def get_group_level(self, group_id: int) -> int:
|
def get_group_level(self, group_id: int) -> int:
|
||||||
"""
|
"""
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user