colorstackorg / oyster

Monorepo that houses ColorStack's core product software.
MIT License
285 stars 140 forks source link

Notify Internal Slack when a thread gets 100+ replies 😅 #535

Open tomas-salgado opened 1 month ago

tomas-salgado commented 1 month ago

Issue Reserved for Bloomberg Mentorship Program

Description

Sometimes things get a little hectic in the family slack..😅 In the case that a single Slack thread gets 100+ replies, we want the admins to get a notification so that they can monitor the thread in case it is getting out of hand.

Acceptance Criteria

Additional Context

We have a function addSlackMessage that retrieves any new Slack message and adds it to the database (see here). Within this function, after adding the message to the database, we can trigger a new function that will count the number of replies in the given thread and notify the admins if there are exactly 100 messages in the thread.

To notify the admins, we can utilize the job notification.slack.send similar to as used here. Note that all we have to do is put the workspace as ‘internal’ and add a message. Make sure to specify which thread is getting long.

ciaracade commented 1 month ago

I’ll take it his