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
b38509b2f5
commit
6769c724cb
@ -26,6 +26,21 @@ __plugin_meta__ = PluginMetadata(
|
|||||||
_matcher = on_alconna(Alconna("关于"), priority=5, block=True, rule=to_me())
|
_matcher = on_alconna(Alconna("关于"), priority=5, block=True, rule=to_me())
|
||||||
|
|
||||||
|
|
||||||
|
QQ_INFO = """
|
||||||
|
『绪山真寻Bot』
|
||||||
|
版本:{version}
|
||||||
|
简介:基于Nonebot2开发,支持多平台,是一个非常可爱的Bot呀,希望与大家要好好相处
|
||||||
|
""".strip()
|
||||||
|
|
||||||
|
INFO = """
|
||||||
|
『绪山真寻Bot』
|
||||||
|
版本:{version}
|
||||||
|
简介:基于Nonebot2开发,支持多平台,是一个非常可爱的Bot呀,希望与大家要好好相处
|
||||||
|
项目地址:https://github.com/zhenxun-org/zhenxun_bot
|
||||||
|
文档地址:https://zhenxun-org.github.io/zhenxun_bot/
|
||||||
|
""".strip()
|
||||||
|
|
||||||
|
|
||||||
@_matcher.handle()
|
@_matcher.handle()
|
||||||
async def _(session: Uninfo, arparma: Arparma):
|
async def _(session: Uninfo, arparma: Arparma):
|
||||||
ver_file = Path() / "__version__"
|
ver_file = Path() / "__version__"
|
||||||
@ -35,25 +50,11 @@ async def _(session: Uninfo, arparma: Arparma):
|
|||||||
if text := await f.read():
|
if text := await f.read():
|
||||||
version = text.split(":")[-1].strip()
|
version = text.split(":")[-1].strip()
|
||||||
if PlatformUtils.is_qbot(session):
|
if PlatformUtils.is_qbot(session):
|
||||||
info: list[str | Path] = [
|
result: list[str | Path] = [QQ_INFO.format(version=version)]
|
||||||
f"""
|
|
||||||
『绪山真寻Bot』
|
|
||||||
版本:{version}
|
|
||||||
简介:基于Nonebot2开发,支持多平台,是一个非常可爱的Bot呀,希望与大家要好好相处
|
|
||||||
""".strip()
|
|
||||||
]
|
|
||||||
path = DATA_PATH / "about.png"
|
path = DATA_PATH / "about.png"
|
||||||
if path.exists():
|
if path.exists():
|
||||||
info.append(path)
|
result.append(path)
|
||||||
|
await MessageUtils.build_message(result).send() # type: ignore
|
||||||
else:
|
else:
|
||||||
info = [
|
await MessageUtils.build_message(INFO.format(version=version)).send()
|
||||||
f"""
|
logger.info("查看关于", arparma.header_result, session=session)
|
||||||
『绪山真寻Bot』
|
|
||||||
版本:{version}
|
|
||||||
简介:基于Nonebot2开发,支持多平台,是一个非常可爱的Bot呀,希望与大家要好好相处
|
|
||||||
项目地址:https://github.com/HibiKier/zhenxun_bot
|
|
||||||
文档地址:https://hibikier.github.io/zhenxun_bot/
|
|
||||||
""".strip()
|
|
||||||
]
|
|
||||||
await MessageUtils.build_message(info).send() # type: ignore
|
|
||||||
logger.info("查看关于", arparma.header_result, session=session)
|
|
||||||
|
|||||||
@ -41,9 +41,9 @@ def convert_module_format(data: str | list[str]) -> str | list[str]:
|
|||||||
str | list[str]: 根据输入类型返回转换后的数据。
|
str | list[str]: 根据输入类型返回转换后的数据。
|
||||||
"""
|
"""
|
||||||
if isinstance(data, str):
|
if isinstance(data, str):
|
||||||
return [item.strip(",") for item in data.split("<") if item]
|
return [item.strip(",") for item in data.split("<") if item.strip()]
|
||||||
else:
|
else:
|
||||||
return "".join(format(item) for item in data)
|
return "".join(add_disable_marker(item) for item in data)
|
||||||
|
|
||||||
|
|
||||||
class GroupConsole(Model):
|
class GroupConsole(Model):
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user