🐛 修复群欢迎消息删除问题

This commit is contained in:
HibiKier 2025-02-27 18:56:28 +08:00
parent f1d32bff89
commit 98a198631e
2 changed files with 4 additions and 2 deletions

View File

@ -125,7 +125,7 @@ async def _(session: Uninfo, arparma: Arparma, idx: Match[int]):
@_del_matcher.handle()
async def _(session: Uninfo, arparma: Arparma, idx: int):
result = await Manager.delete_group_message(session, int(idx))
result = await Manager.delete_group_message(session, idx)
if not result:
await MessageUtils.build_message("未查找到指定id的群组欢迎消息...").finish()
await MessageUtils.build_message(result).send()

View File

@ -248,9 +248,11 @@ class Manager:
返回:
list: 消息内容
"""
path = cls.get_path(session)
json_data = cls.__get_data(session)
if not json_data:
if not json_data or not path:
return None
file = path / "text.json"
key_list = list(json_data.keys())
if idx < 0 or idx >= len(key_list):
return None