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
Implement a function within ‘packages/core/src/modules/slack/queries' that counts the number of replies a thread has (this will require counting how many times that particular threadId appears in the database)
This function should also check if the number of messages in the thread is exactly 100, in which case the function should send a notification to the internal slack with a message implying that a particular thread is getting long
This function should be called within the addSlackMessage function after adding a new message to the database
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.
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
threadId
appears in the database)addSlackMessage
function after adding a new message to the databaseAdditional 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.