From 2810fc5fc6963c88310b03846435071b6d3d0b79 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 03:26:39 +0000 Subject: [PATCH 1/3] Initial plan From 93442fd21b484d3d6fecfc86ffe64d65564998e7 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 03:28:40 +0000 Subject: [PATCH 2/3] Add optional @mention for daily and rob wife messages --- README.md | 1 + __init__.py | 21 +++++++++++++++------ config_default.py | 5 +++++ 3 files changed, 21 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index b40d40d..0e71413 100644 --- a/README.md +++ b/README.md @@ -42,6 +42,7 @@ gs_wuwa_daily_wife - `DailyWifeGalleryUsername`:画廊账号; - `DailyWifeGalleryPassword`:画廊密码; - `DailyWifeSendText`:是否发送“你今天的老婆是xxx”; +- `DailyWifeAtUser`:发送今日老婆和抢老婆成功图片时是否艾特对应用户; - `DailyWifeShowRoleId`:是否显示角色 ID; - `DailyWifeTextTemplate`:文字模板,可用变量 `{name}`、`{role_id}`; - `DailyWifeMasterUnlimited`:主人无限抽老婆,开启后 GSCore 主人不会固定当天结果; diff --git a/__init__.py b/__init__.py index 37b74f6..c08b82c 100644 --- a/__init__.py +++ b/__init__.py @@ -355,7 +355,13 @@ async def _ensure_daily_wife_record(ev: Event, user_id: str | int | None = None) return record -async def _send_role_image(bot: Bot, role: RoleCandidate, image_url: str, text: str | None = None) -> None: +async def _send_role_image( + bot: Bot, + role: RoleCandidate, + image_url: str, + text: str | None = None, + user_id: str | int | None = None, +) -> None: try: image = await _download_image(image_url) except RuntimeError as exc: @@ -363,10 +369,13 @@ async def _send_role_image(bot: Bot, role: RoleCandidate, image_url: str, text: await bot.send(str(exc)) return + messages: list[Any] = [] + if user_id is not None and bool(_cfg('DailyWifeAtUser')): + messages.append(MessageSegment.at(user_id)) if text: - await bot.send([text, MessageSegment.image(image)]) - else: - await bot.send(MessageSegment.image(image)) + messages.append(text) + messages.append(MessageSegment.image(image)) + await bot.send(messages if len(messages) > 1 else messages[0]) async def _send_daily_wife(bot: Bot, ev: Event): @@ -392,7 +401,7 @@ async def _send_daily_wife(bot: Bot, ev: Event): ) text = _build_text(role) if bool(_cfg('DailyWifeSendText')) else None - await _send_role_image(bot, role, image, text) + await _send_role_image(bot, role, image, text, ev.user_id) async def _send_rob_wife(bot: Bot, ev: Event): @@ -428,7 +437,7 @@ async def _send_rob_wife(bot: Bot, ev: Event): role = target_record.to_role() text = _build_rob_success_text(role, target_user_id) if bool(_cfg('DailyWifeSendText')): - await _send_role_image(bot, role, target_record.image, text) + await _send_role_image(bot, role, target_record.image, text, robber_id) else: await bot.send(text) diff --git a/config_default.py b/config_default.py index 0fb877f..fa6d19c 100644 --- a/config_default.py +++ b/config_default.py @@ -29,6 +29,11 @@ '开启后图片前附带“你今天的老婆是xxx”', True, ), + 'DailyWifeAtUser': GsBoolConfig( + '发送时艾特触发者', + '开启后发送今日老婆和抢老婆成功图片时会艾特对应用户', + True, + ), 'DailyWifeShowRoleId': GsBoolConfig( '显示角色 ID', '开启后在文字说明里额外显示本次角色对应的数字 ID', From 8c76bf0780a3ef5f64044172a13b64bf364bbf4c Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 9 Jun 2026 03:30:07 +0000 Subject: [PATCH 3/3] Ensure rob success @mention works without image text mode --- __init__.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/__init__.py b/__init__.py index c08b82c..9399f20 100644 --- a/__init__.py +++ b/__init__.py @@ -439,7 +439,10 @@ async def _send_rob_wife(bot: Bot, ev: Event): if bool(_cfg('DailyWifeSendText')): await _send_role_image(bot, role, target_record.image, text, robber_id) else: - await bot.send(text) + if bool(_cfg('DailyWifeAtUser')): + await bot.send([MessageSegment.at(robber_id), text]) + else: + await bot.send(text) @sv.on_fullmatch('今日老婆', block=True)