From 564bfba8eea074206e8bfd92a15531f35771d0ea Mon Sep 17 00:00:00 2001 From: alexlam0206 Date: Thu, 12 Mar 2026 20:07:24 +0800 Subject: [PATCH 01/10] Add ?lqvote and ?votequeue for flavortown --- README.md | 3 ++ nephthys/macros/lqvotes.py | 39 ++++++++++++++++++ nephthys/macros/votequeue.py | 40 +++++++++++++++++++ nephthys/transcripts/transcript.py | 10 +++++ .../transcripts/transcripts/flavortown.py | 18 +++++++++ 5 files changed, 110 insertions(+) create mode 100644 nephthys/macros/lqvotes.py create mode 100644 nephthys/macros/votequeue.py diff --git a/README.md b/README.md index df39feb..7af47c6 100644 --- a/README.md +++ b/README.md @@ -30,6 +30,9 @@ Sometimes it’s nice to be able to do things quickly... Here’s where macros c - `?fraud` - redirect to Fraud Squad - `?thread` - remove the reaction and all Nephthys replies to unclutter duplicates - `?shipwrights` - redirect to #ask-the-shipwrights +- `?votequeue` - tell them to wait for votes because there's a backlog of projects waiting for votes +- `?lqvote` - explain how to cast high quality votes + - more to come?? feel free to PR your own into hackclub/nephthys or tell me what you want ### Stale diff --git a/nephthys/macros/lqvotes.py b/nephthys/macros/lqvotes.py new file mode 100644 index 0000000..58f03f8 --- /dev/null +++ b/nephthys/macros/lqvotes.py @@ -0,0 +1,39 @@ +from nephthys.actions.resolve import resolve +from nephthys.macros.types import Macro +from nephthys.utils.env import env +from nephthys.utils.slack_user import get_user_profile +from nephthys.utils.ticket_methods import reply_to_ticket + + +class LQVotes(Macro): + name = "lqvote" + aliases = ["lqvote", "lqvotes"] + + async def run(self, ticket, helper, **kwargs): + """ + Macro to warn users their votes are being marked low-quality. + """ + macro_text = env.transcript.lqvotes_macro + if not macro_text: + await env.slack_client.chat_postEphemeral( + channel=env.slack_help_channel, + thread_ts=ticket.msgTs, + user=helper.slackId, + text=f"Invalid macro: The `{self.name}` macro is not configured for this channel.", + ) + return + sender = await env.db.user.find_first(where={"id": ticket.openedById}) + if not sender: + return + user = await get_user_profile(sender.slackId) + await reply_to_ticket( + text=macro_text.replace("(user)", user.display_name()), + ticket=ticket, + client=env.slack_client, + ) + await resolve( + ts=ticket.msgTs, + resolver=helper.slackId, + client=env.slack_client, + send_resolved_message=False, + ) diff --git a/nephthys/macros/votequeue.py b/nephthys/macros/votequeue.py new file mode 100644 index 0000000..225a288 --- /dev/null +++ b/nephthys/macros/votequeue.py @@ -0,0 +1,40 @@ +from nephthys.actions.resolve import resolve +from nephthys.macros.types import Macro +from nephthys.utils.env import env +from nephthys.utils.slack_user import get_user_profile +from nephthys.utils.ticket_methods import reply_to_ticket + + +class VoteQueue(Macro): + name = "votequeue" + aliases = ["votequeue", "voteq"] + + async def run(self, ticket, helper, **kwargs): + """ + Macro to tell people about the voting queue + """ + macro_text = env.transcript.votequeue_macro + if not macro_text: + # Not all events have this macro + await env.slack_client.chat_postEphemeral( + channel=env.slack_help_channel, + thread_ts=ticket.msgTs, + user=helper.slackId, + text=f"Invalid macro: The `{self.name}` macro is not configured for this channel.", + ) + return + sender = await env.db.user.find_first(where={"id": ticket.openedById}) + if not sender: + return + user = await get_user_profile(sender.slackId) + await reply_to_ticket( + text=macro_text.replace("(user)", user.display_name()), + ticket=ticket, + client=env.slack_client, + ) + await resolve( + ts=ticket.msgTs, + resolver=helper.slackId, + client=env.slack_client, + send_resolved_message=False, + ) diff --git a/nephthys/transcripts/transcript.py b/nephthys/transcripts/transcript.py index ee8f0cf..b487e7f 100644 --- a/nephthys/transcripts/transcript.py +++ b/nephthys/transcripts/transcript.py @@ -100,6 +100,16 @@ def program_snake_case(self) -> str: description="Message to be sent when the ship cert queue macro is used (only applies to Flavortown and SoM)", ) + votequeue_macro: str | None = Field( + default=None, + description="Message to be sent when the vote queue macro is used (only applies to Flavortown)", + ) + + lqvotes_macro: str | None = Field( + default=None, + description="Message to be sent when votes are marked low-quality (Flavortown)", + ) + not_allowed_channel: str = Field( default="", description="Message for unauthorized channel access" ) diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index 29cfc5e..0570ca0 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -54,3 +54,21 @@ class Flavortown(Transcript): ship_cert_queue_macro: str | None = ( "Hey (user), we currently have a backlog of projects waiting to be certified. Please be patient.\n\n*You can keep track of the queue !*" ) + + votequeue_macro: str | None = ( + """ + Hey (user), we currently have a backlog of projects waiting for votes to be voted on. Please be patient. + + _I've marked this question as resolved, so please start a new thread if it's too long or you need more help!_ + """ + ) + + lqvotes_macro: str | None = ( + "Hey (user), some of your votes are likely being marked as low quality votes and are discarded.\n\n" + "Go to . You will get a project shown to you. Make sure you are:\n" + "- checking both the repo and demo links\n" + "- spending some time looking through the project's devlogs\n" + "- giving good, thoughtful scores and feedback\n" + "- generally caring and not rushing through voting\n\n" + "*_Casting low quality votes might receive a lower payout!_*" + ) From 3773bbf6fd1752ad7eb927fce52886f7f25c40d2 Mon Sep 17 00:00:00 2001 From: alexlam0206 Date: Thu, 12 Mar 2026 20:52:50 +0800 Subject: [PATCH 02/10] Run pre-commit formatting --- nephthys/transcripts/transcript.py | 1 - nephthys/transcripts/transcripts/flavortown.py | 12 +++++------- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/nephthys/transcripts/transcript.py b/nephthys/transcripts/transcript.py index b487e7f..017707b 100644 --- a/nephthys/transcripts/transcript.py +++ b/nephthys/transcripts/transcript.py @@ -104,7 +104,6 @@ def program_snake_case(self) -> str: default=None, description="Message to be sent when the vote queue macro is used (only applies to Flavortown)", ) - lqvotes_macro: str | None = Field( default=None, description="Message to be sent when votes are marked low-quality (Flavortown)", diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index 0570ca0..193ce73 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -55,13 +55,11 @@ class Flavortown(Transcript): "Hey (user), we currently have a backlog of projects waiting to be certified. Please be patient.\n\n*You can keep track of the queue !*" ) - votequeue_macro: str | None = ( - """ - Hey (user), we currently have a backlog of projects waiting for votes to be voted on. Please be patient. - - _I've marked this question as resolved, so please start a new thread if it's too long or you need more help!_ - """ - ) + votequeue_macro: str | None = """ +Hey (user), we currently have a backlog of projects waiting for votes to be voted on. Please be patient. + +_I've marked this question as resolved, so please start a new thread if it's too long or you need more help!_ +""" lqvotes_macro: str | None = ( "Hey (user), some of your votes are likely being marked as low quality votes and are discarded.\n\n" From 2c8eca9dca4aa57df7836bdfad854b7919428d5b Mon Sep 17 00:00:00 2001 From: alexlam0206 Date: Thu, 12 Mar 2026 21:05:04 +0800 Subject: [PATCH 03/10] Fix: ft-maacros-nok pre-commit --- nephthys/transcripts/transcript.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nephthys/transcripts/transcript.py b/nephthys/transcripts/transcript.py index 017707b..bd2962b 100644 --- a/nephthys/transcripts/transcript.py +++ b/nephthys/transcripts/transcript.py @@ -108,7 +108,7 @@ def program_snake_case(self) -> str: default=None, description="Message to be sent when votes are marked low-quality (Flavortown)", ) - + not_allowed_channel: str = Field( default="", description="Message for unauthorized channel access" ) From c43efa401001a967d21051a15cb9e9f8233e6df9 Mon Sep 17 00:00:00 2001 From: alexlam0206 Date: Fri, 13 Mar 2026 20:51:33 +0800 Subject: [PATCH 04/10] fix: wordings (ft-macros-nok) --- nephthys/transcripts/transcripts/flavortown.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index 193ce73..93e5f59 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -68,5 +68,5 @@ class Flavortown(Transcript): "- spending some time looking through the project's devlogs\n" "- giving good, thoughtful scores and feedback\n" "- generally caring and not rushing through voting\n\n" - "*_Casting low quality votes might receive a lower payout!_*" + "*_Low quality votes won't count towards your vote requirement!_*" ) From e0f45bdc3d64c32a31a6176429d4e2a090e366ed Mon Sep 17 00:00:00 2001 From: MMK21 <50421330+MMK21Hub@users.noreply.github.com> Date: Wed, 25 Mar 2026 11:42:49 +0000 Subject: [PATCH 05/10] Remove the vote queue macro --- README.md | 1 - nephthys/macros/votequeue.py | 40 ------------------- nephthys/transcripts/transcript.py | 4 -- .../transcripts/transcripts/flavortown.py | 6 --- 4 files changed, 51 deletions(-) delete mode 100644 nephthys/macros/votequeue.py diff --git a/README.md b/README.md index 7af47c6..9a419aa 100644 --- a/README.md +++ b/README.md @@ -30,7 +30,6 @@ Sometimes it’s nice to be able to do things quickly... Here’s where macros c - `?fraud` - redirect to Fraud Squad - `?thread` - remove the reaction and all Nephthys replies to unclutter duplicates - `?shipwrights` - redirect to #ask-the-shipwrights -- `?votequeue` - tell them to wait for votes because there's a backlog of projects waiting for votes - `?lqvote` - explain how to cast high quality votes - more to come?? feel free to PR your own into hackclub/nephthys or tell me what you want diff --git a/nephthys/macros/votequeue.py b/nephthys/macros/votequeue.py deleted file mode 100644 index 225a288..0000000 --- a/nephthys/macros/votequeue.py +++ /dev/null @@ -1,40 +0,0 @@ -from nephthys.actions.resolve import resolve -from nephthys.macros.types import Macro -from nephthys.utils.env import env -from nephthys.utils.slack_user import get_user_profile -from nephthys.utils.ticket_methods import reply_to_ticket - - -class VoteQueue(Macro): - name = "votequeue" - aliases = ["votequeue", "voteq"] - - async def run(self, ticket, helper, **kwargs): - """ - Macro to tell people about the voting queue - """ - macro_text = env.transcript.votequeue_macro - if not macro_text: - # Not all events have this macro - await env.slack_client.chat_postEphemeral( - channel=env.slack_help_channel, - thread_ts=ticket.msgTs, - user=helper.slackId, - text=f"Invalid macro: The `{self.name}` macro is not configured for this channel.", - ) - return - sender = await env.db.user.find_first(where={"id": ticket.openedById}) - if not sender: - return - user = await get_user_profile(sender.slackId) - await reply_to_ticket( - text=macro_text.replace("(user)", user.display_name()), - ticket=ticket, - client=env.slack_client, - ) - await resolve( - ts=ticket.msgTs, - resolver=helper.slackId, - client=env.slack_client, - send_resolved_message=False, - ) diff --git a/nephthys/transcripts/transcript.py b/nephthys/transcripts/transcript.py index bd2962b..df1cfe7 100644 --- a/nephthys/transcripts/transcript.py +++ b/nephthys/transcripts/transcript.py @@ -100,10 +100,6 @@ def program_snake_case(self) -> str: description="Message to be sent when the ship cert queue macro is used (only applies to Flavortown and SoM)", ) - votequeue_macro: str | None = Field( - default=None, - description="Message to be sent when the vote queue macro is used (only applies to Flavortown)", - ) lqvotes_macro: str | None = Field( default=None, description="Message to be sent when votes are marked low-quality (Flavortown)", diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index 93e5f59..4d474d9 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -55,12 +55,6 @@ class Flavortown(Transcript): "Hey (user), we currently have a backlog of projects waiting to be certified. Please be patient.\n\n*You can keep track of the queue !*" ) - votequeue_macro: str | None = """ -Hey (user), we currently have a backlog of projects waiting for votes to be voted on. Please be patient. - -_I've marked this question as resolved, so please start a new thread if it's too long or you need more help!_ -""" - lqvotes_macro: str | None = ( "Hey (user), some of your votes are likely being marked as low quality votes and are discarded.\n\n" "Go to . You will get a project shown to you. Make sure you are:\n" From 61b63ea8dd98355cd00bbded2c51e62c68b26777 Mon Sep 17 00:00:00 2001 From: MMK21 <50421330+MMK21Hub@users.noreply.github.com> Date: Wed, 25 Mar 2026 11:45:20 +0000 Subject: [PATCH 06/10] Change phrasing of low quality votes macro --- nephthys/transcripts/transcripts/flavortown.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index 4d474d9..e85f509 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -56,11 +56,11 @@ class Flavortown(Transcript): ) lqvotes_macro: str | None = ( - "Hey (user), some of your votes are likely being marked as low quality votes and are discarded.\n\n" - "Go to . You will get a project shown to you. Make sure you are:\n" - "- checking both the repo and demo links\n" - "- spending some time looking through the project's devlogs\n" - "- giving good, thoughtful scores and feedback\n" - "- generally caring and not rushing through voting\n\n" + "Hey (user), some of your votes are likely being marked as low quality and are discarded.\n\n" + "When you're , make sure that you are:\n" + "- Checking both the repo and demo links\n" + "- Spending some time looking through the project's devlogs\n" + "- Giving good, thoughtful scores and feedback\n" + "- Generally caring and not rushing through voting\n\n" "*_Low quality votes won't count towards your vote requirement!_*" ) From 716675619784612cba948168eeab96548e167d38 Mon Sep 17 00:00:00 2001 From: MMK21 <50421330+MMK21Hub@users.noreply.github.com> Date: Wed, 25 Mar 2026 11:47:12 +0000 Subject: [PATCH 07/10] Avoid abbreviations in variable names --- nephthys/macros/lqvotes.py | 4 ++-- nephthys/transcripts/transcript.py | 2 +- nephthys/transcripts/transcripts/flavortown.py | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/nephthys/macros/lqvotes.py b/nephthys/macros/lqvotes.py index 58f03f8..d84ce16 100644 --- a/nephthys/macros/lqvotes.py +++ b/nephthys/macros/lqvotes.py @@ -5,7 +5,7 @@ from nephthys.utils.ticket_methods import reply_to_ticket -class LQVotes(Macro): +class LowQualityVotes(Macro): name = "lqvote" aliases = ["lqvote", "lqvotes"] @@ -13,7 +13,7 @@ async def run(self, ticket, helper, **kwargs): """ Macro to warn users their votes are being marked low-quality. """ - macro_text = env.transcript.lqvotes_macro + macro_text = env.transcript.low_quality_votes_macro if not macro_text: await env.slack_client.chat_postEphemeral( channel=env.slack_help_channel, diff --git a/nephthys/transcripts/transcript.py b/nephthys/transcripts/transcript.py index df1cfe7..7c18010 100644 --- a/nephthys/transcripts/transcript.py +++ b/nephthys/transcripts/transcript.py @@ -100,7 +100,7 @@ def program_snake_case(self) -> str: description="Message to be sent when the ship cert queue macro is used (only applies to Flavortown and SoM)", ) - lqvotes_macro: str | None = Field( + low_quality_votes_macro: str | None = Field( default=None, description="Message to be sent when votes are marked low-quality (Flavortown)", ) diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index e85f509..806dc54 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -55,7 +55,7 @@ class Flavortown(Transcript): "Hey (user), we currently have a backlog of projects waiting to be certified. Please be patient.\n\n*You can keep track of the queue !*" ) - lqvotes_macro: str | None = ( + low_quality_votes_macro: str | None = ( "Hey (user), some of your votes are likely being marked as low quality and are discarded.\n\n" "When you're , make sure that you are:\n" "- Checking both the repo and demo links\n" From 95549c456574e74fd525a3aaeddbf01fc3cad372 Mon Sep 17 00:00:00 2001 From: MMK21 <50421330+MMK21Hub@users.noreply.github.com> Date: Wed, 25 Mar 2026 11:52:01 +0000 Subject: [PATCH 08/10] Rename lqvotes.py => low_quality_votes.py --- nephthys/macros/{lqvotes.py => low_quality_votes.py} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename nephthys/macros/{lqvotes.py => low_quality_votes.py} (100%) diff --git a/nephthys/macros/lqvotes.py b/nephthys/macros/low_quality_votes.py similarity index 100% rename from nephthys/macros/lqvotes.py rename to nephthys/macros/low_quality_votes.py From 751b4ea49f06af574dd3678df343f2ddd1a65d69 Mon Sep 17 00:00:00 2001 From: MMK21 <50421330+MMK21Hub@users.noreply.github.com> Date: Wed, 25 Mar 2026 11:53:18 +0000 Subject: [PATCH 09/10] Actually import the low-quality votes macro --- nephthys/macros/__init__.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/nephthys/macros/__init__.py b/nephthys/macros/__init__.py index 9a36ce7..654b001 100644 --- a/nephthys/macros/__init__.py +++ b/nephthys/macros/__init__.py @@ -4,6 +4,7 @@ from nephthys.macros.fraud import Fraud from nephthys.macros.hello_world import HelloWorld from nephthys.macros.identity import Identity +from nephthys.macros.low_quality_votes import LowQualityVotes from nephthys.macros.reopen import Reopen from nephthys.macros.resolve import Resolve from nephthys.macros.shipcertqueue import ShipCertQueue @@ -32,6 +33,7 @@ FulfillmentReminder, Shipwrights, TeamTag, + LowQualityVotes, ] macros = [macro() for macro in macro_list] From 5fecbac385238bee206b7003afe0f4974301f89b Mon Sep 17 00:00:00 2001 From: MMK21 <50421330+MMK21Hub@users.noreply.github.com> Date: Wed, 25 Mar 2026 11:55:13 +0000 Subject: [PATCH 10/10] Make low_quality_votes_macro a bit more professional-looking --- nephthys/transcripts/transcripts/flavortown.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/nephthys/transcripts/transcripts/flavortown.py b/nephthys/transcripts/transcripts/flavortown.py index 806dc54..7c82ee0 100644 --- a/nephthys/transcripts/transcripts/flavortown.py +++ b/nephthys/transcripts/transcripts/flavortown.py @@ -58,9 +58,9 @@ class Flavortown(Transcript): low_quality_votes_macro: str | None = ( "Hey (user), some of your votes are likely being marked as low quality and are discarded.\n\n" "When you're , make sure that you are:\n" - "- Checking both the repo and demo links\n" - "- Spending some time looking through the project's devlogs\n" - "- Giving good, thoughtful scores and feedback\n" - "- Generally caring and not rushing through voting\n\n" - "*_Low quality votes won't count towards your vote requirement!_*" + "• Checking both the repo and demo links\n" + "• Spending some time looking through the project's devlogs\n" + "• Giving good, thoughtful scores and feedback\n" + "• Generally caring and not rushing through voting\n\n" + "_Low quality votes won't count towards your vote requirement!_" )