Use base macro for lookup-reply-resolve macros#183
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
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.
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 looks great from checking the code! (just need to test it) Thanks for the PR! |
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
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