Skip to content

Use base macro for lookup-reply-resolve macros#183

Open
twonfi wants to merge 4 commits intohackclub:mainfrom
twonfi:base-for-reply-macros
Open

Use base macro for lookup-reply-resolve macros#183
twonfi wants to merge 4 commits intohackclub:mainfrom
twonfi:base-for-reply-macros

Conversation

@twonfi
Copy link
Copy Markdown
Member

@twonfi twonfi commented Mar 30, 2026

This adds nephthys.macros.types.ReplyMacro, which is a simple base macro class for macros like ?shipwrights and ?identity that follow the lookup-reply-resolve logic.

I moved docstrings from the run method to the class itself, which we can do for the other macros.

Per comment and to make the code DRYer.

Closes #182

This adds `nephthys.macros.types.ReplyMacro`, which is a simple base
macro class for macros like `?shipwrights` and `?identity` that follow
the lookup-reply-resolve logic.

Closes hackclub#182
Copilot AI review requested due to automatic review settings March 30, 2026 16:44
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Introduces a new ReplyMacro base class to consolidate the common “lookup sender → reply → resolve” pattern used by several simple macros, reducing duplicated logic across the macros subsystem.

Changes:

  • Add nephthys.macros.types.ReplyMacro implementing shared lookup/reply/resolve behavior.
  • Refactor shipwrights, identity, fraud, and faq macros to inherit from ReplyMacro and provide message + class-level docstrings.
  • Centralize resolving behavior behind a resolve_ticket flag on the base class.

Reviewed changes

Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
nephthys/macros/types.py Adds ReplyMacro base class and shared run logic for reply+resolve macros.
nephthys/macros/shipwrights.py Converts Shipwrights macro to ReplyMacro with static message.
nephthys/macros/identity.py Converts Identity macro to ReplyMacro with static message.
nephthys/macros/fraud.py Converts Fraud macro to ReplyMacro with static message.
nephthys/macros/faq.py Converts FAQ macro to ReplyMacro with static message.

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

Copilot AI review requested due to automatic review settings March 30, 2026 17:19
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Copilot reviewed 5 out of 5 changed files in this pull request and generated 1 comment.


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

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.

Use base macro for lookup-reply-resolve macros

2 participants