Skip to content

Commit c7cb401

Browse files
committed
Use the reply_to_ticket util in macros
1 parent ccebf87 commit c7cb401

File tree

5 files changed

+20
-15
lines changed

5 files changed

+20
-15
lines changed

nephthys/macros/faq.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from nephthys.actions.resolve import resolve
22
from nephthys.macros.types import Macro
33
from nephthys.utils.env import env
4+
from nephthys.utils.ticket_methods import reply_to_ticket
45

56

67
class FAQ(Macro):
@@ -19,10 +20,10 @@ async def run(self, ticket, helper, **kwargs):
1920
or user_info["user"]["profile"].get("real_name")
2021
or user_info["user"]["name"]
2122
)
22-
await env.slack_client.chat_postMessage(
23+
await reply_to_ticket(
2324
text=f"hey, {name}! this question is answered in the faq i sent earlier, please make sure to check it out! :rac_cute:\n\n<{env.transcript.faq_link}|here it is again>",
24-
channel=env.slack_help_channel,
25-
thread_ts=ticket.msgTs,
25+
ticket=ticket,
26+
client=env.slack_client,
2627
)
2728
await resolve(
2829
ts=ticket.msgTs,

nephthys/macros/fraud.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from nephthys.actions.resolve import resolve
22
from nephthys.macros.types import Macro
33
from nephthys.utils.env import env
4+
from nephthys.utils.ticket_methods import reply_to_ticket
45

56

67
class Fraud(Macro):
@@ -19,10 +20,10 @@ async def run(self, ticket, helper, **kwargs):
1920
or user_info["user"]["profile"].get("real_name")
2021
or user_info["user"]["name"]
2122
)
22-
await env.slack_client.chat_postMessage(
23+
await reply_to_ticket(
2324
text=f"Hiya {name}! Would you mind directing any fraud related queries to <@U091HC53CE8>? :rac_cute:\n\nIt'll keep your case confidential and make it easier for the fraud team to keep track of!",
24-
channel=env.slack_help_channel,
25-
thread_ts=ticket.msgTs,
25+
ticket=ticket,
26+
client=env.slack_client,
2627
)
2728
await resolve(
2829
ts=ticket.msgTs,

nephthys/macros/hello_world.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from nephthys.macros.types import Macro
22
from nephthys.utils.env import env
3+
from nephthys.utils.ticket_methods import reply_to_ticket
34

45

56
class HelloWorld(Macro):
@@ -15,8 +16,8 @@ async def run(self, ticket, helper, **kwargs):
1516
or user_info["user"]["profile"].get("real_name")
1617
or user_info["user"]["name"]
1718
)
18-
await env.slack_client.chat_postMessage(
19+
await reply_to_ticket(
1920
text=f"hey, {name}! i'm heidi :rac_shy: say hi to orpheus for me would you? :rac_cute:",
20-
channel=env.slack_help_channel,
21-
thread_ts=ticket.msgTs,
21+
ticket=ticket,
22+
client=env.slack_client,
2223
)

nephthys/macros/identity.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from nephthys.actions.resolve import resolve
22
from nephthys.macros.types import Macro
33
from nephthys.utils.env import env
4+
from nephthys.utils.ticket_methods import reply_to_ticket
45

56

67
class Identity(Macro):
@@ -19,10 +20,10 @@ async def run(self, ticket, helper, **kwargs):
1920
or user_info["user"]["profile"].get("real_name")
2021
or user_info["user"]["name"]
2122
)
22-
await env.slack_client.chat_postMessage(
23+
await reply_to_ticket(
2324
text=f"hey, {name}! please could you ask questions about identity verification in <#{env.transcript.identity_help_channel}>? :rac_cute:\n\nit helps the verification team keep track of questions easier!",
24-
channel=env.slack_help_channel,
25-
thread_ts=ticket.msgTs,
25+
ticket=ticket,
26+
client=env.slack_client,
2627
)
2728
await resolve(
2829
ts=ticket.msgTs,

nephthys/macros/shipcertqueue.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from nephthys.actions.resolve import resolve
22
from nephthys.macros.types import Macro
33
from nephthys.utils.env import env
4+
from nephthys.utils.ticket_methods import reply_to_ticket
45

56

67
class ShipCertQueue(Macro):
@@ -19,10 +20,10 @@ async def run(self, ticket, helper, **kwargs):
1920
or user_info["user"]["profile"].get("real_name")
2021
or user_info["user"]["name"]
2122
)
22-
await env.slack_client.chat_postMessage(
23+
await reply_to_ticket(
2324
text=f"Hi {name}! Unfortunately, there is a backlog of projects awaiting ship certification; please be patient. \n\n *pssst... voting more will move your project further towards the front of the queue.*",
24-
channel=env.slack_help_channel,
25-
thread_ts=ticket.msgTs,
25+
ticket=ticket,
26+
client=env.slack_client,
2627
)
2728
await resolve(
2829
ts=ticket.msgTs,

0 commit comments

Comments
 (0)