Use base macro for lookup-reply-resolve macros#183
Open
twonfi wants to merge 4 commits intohackclub:mainfrom
Open
Use base macro for lookup-reply-resolve macros#183twonfi wants to merge 4 commits intohackclub:mainfrom
twonfi wants to merge 4 commits intohackclub:mainfrom
Conversation
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
Contributor
There was a problem hiding this comment.
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.ReplyMacroimplementing shared lookup/reply/resolve behavior. - Refactor
shipwrights,identity,fraud, andfaqmacros to inherit fromReplyMacroand providemessage+ class-level docstrings. - Centralize resolving behavior behind a
resolve_ticketflag 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.
Contributor
There was a problem hiding this comment.
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This adds
nephthys.macros.types.ReplyMacro, which is a simple base macro class for macros like?shipwrightsand?identitythat follow the lookup-reply-resolve logic.I moved docstrings from the
runmethod to the class itself, which we can do for the other macros.Per comment and to make the code DRYer.
Closes #182