forked from MadisonReed/oncall-slackbot
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
move to using escalation policies instead of schedules
- Loading branch information
1 parent
9e99d96
commit 3c71373
Showing
9 changed files
with
3,480 additions
and
80 deletions.
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,26 @@ | ||
import { getOncallSlackMembers } from "@api/oncall"; | ||
import { makeOncallMappingMessage } from "@api/pd"; | ||
import { getOncallSlackMembers } from '@api/oncall'; | ||
import { makeOncallMappingMessage } from '@api/pd'; | ||
|
||
|
||
const handleLsCommand = async ( | ||
threadTs: string, | ||
say:Function, | ||
) => { | ||
const slackMembers = await getOncallSlackMembers(); | ||
const usersMessage = makeOncallMappingMessage(slackMembers); | ||
await say({ | ||
text: `Current oncall listing:\n ${usersMessage}`, | ||
thread_ts: threadTs, | ||
}); | ||
const handleLsCommand = async (threadTs: string, say: Function) => { | ||
const slackMembers = await getOncallSlackMembers(); | ||
const usersMessage = makeOncallMappingMessage(slackMembers); | ||
console.log(`total slack members: ${slackMembers.length}`); | ||
// console.log('slack members:', JSON.stringify(slackMembers, null, 2)); | ||
console.log( | ||
`tom user: ${JSON.stringify( | ||
slackMembers.find( | ||
(s) => | ||
s.name.toLowerCase().includes('thom') || | ||
s.name.toLowerCase().includes('tom') | ||
), | ||
null, | ||
2 | ||
)}` | ||
); | ||
await say({ | ||
text: `Current oncall listing:\n ${usersMessage}`, | ||
thread_ts: threadTs, | ||
}); | ||
}; | ||
|
||
export default handleLsCommand; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.