Skip to content

Add configurable user @mention for daily wife and rob-success messages#1

Merged
CWalkene merged 3 commits into
mainfrom
copilot/add-at-mention-functionality
Jun 9, 2026
Merged

Add configurable user @mention for daily wife and rob-success messages#1
CWalkene merged 3 commits into
mainfrom
copilot/add-at-mention-functionality

Conversation

Copilot AI commented Jun 9, 2026

Copy link
Copy Markdown

This change adds optional @mention behavior to outbound wife messages so the initiating user is explicitly pinged. It covers both 今日老婆 and successful 抢老婆 flows, controlled by a new console config switch.

  • Config: add mention toggle

    • Introduced DailyWifeAtUser in config_default.py (boolean, default True).
    • Purpose: globally enable/disable @user in daily-wife and rob-success sends without changing templates.
  • Message send path: support optional target user

    • Extended _send_role_image() signature to accept user_id.
    • When DailyWifeAtUser is enabled and user_id is provided, prepends MessageSegment.at(user_id) before text/image payload.
  • Call-site wiring

    • Daily wife flow now passes ev.user_id into _send_role_image().
    • Rob-wife success flow now passes robber_id into _send_role_image().
    • Rob success text-only branch (DailyWifeSendText=False) now also applies @robber when enabled.
# __init__.py (core behavior)
if user_id is not None and bool(_cfg('DailyWifeAtUser')):
    messages.append(MessageSegment.at(user_id))

Copilot AI changed the title [WIP] Add functionality to @mention users in daily messages Add configurable user @mention for daily wife and rob-success messages Jun 9, 2026
Copilot AI requested a review from CWalkene June 9, 2026 03:31
@CWalkene
CWalkene marked this pull request as ready for review June 9, 2026 03:36
Copilot AI review requested due to automatic review settings June 9, 2026 03:36
@CWalkene
CWalkene merged commit 2779efc into main Jun 9, 2026
1 check passed

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds a new console configuration switch to optionally @mention the initiating user in “今日老婆” and “抢老婆成功” outbound messages, by extending the shared image-send helper and wiring the caller IDs through the daily/rob flows.

Changes:

  • Added DailyWifeAtUser boolean config (default True) to control whether the trigger user is @mentioned.
  • Extended _send_role_image() to accept an optional user_id and prepend MessageSegment.at(user_id) when enabled.
  • Updated daily-wife and rob-success send paths to pass the appropriate user id and to @mention in the rob-success text-only branch.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
README.md Documents the new DailyWifeAtUser configuration option.
config_default.py Introduces the DailyWifeAtUser toggle in default plugin config.
init.py Implements optional @mention behavior in message send flows and helper.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread config_default.py
Comment on lines +32 to +36
'DailyWifeAtUser': GsBoolConfig(
'发送时艾特触发者',
'开启后发送今日老婆和抢老婆成功图片时会艾特对应用户',
True,
),
Comment thread README.md
@MimoKit
MimoKit deleted the copilot/add-at-mention-functionality branch June 9, 2026 03:46
@MimoKit
MimoKit restored the copilot/add-at-mention-functionality branch June 9, 2026 03:46
@MimoKit
MimoKit deleted the copilot/add-at-mention-functionality branch June 13, 2026 07:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants