Skip to content

Commit

Permalink
handle when the oncall doesn't exist
Browse files Browse the repository at this point in the history
  • Loading branch information
after-ephemera committed Mar 7, 2024
1 parent 17e7706 commit a99870a
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion src/api/oncall/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const getOncallSlackMembers = async (): Promise<OncallSlackUser[]> => {
slackUser.id ?? ""
)
);
if (slackUser.name !== undefined) {
if (slackUser && slackUser.name !== undefined) {
oncallSlackerNames.push(slackUser.name);
}
} catch (e) {
Expand Down
2 changes: 1 addition & 1 deletion src/api/pd/ls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ export const makeOncallMappingMessage = (
.map(
([shortnames, s]: Array<string[] | OncallSlackUser | undefined>) =>
`(${(shortnames as string[]).join(" | ")}): @${
(s as OncallSlackUser).name
(s as OncallSlackUser)?.name
}`
)
.join("\n")
Expand Down
2 changes: 1 addition & 1 deletion src/listeners/events/app-mentioned.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const appMentionedCallback = async ({
event,
say,
}: AllMiddlewareArgs & SlackEventMiddlewareArgs<"app_mention">): Promise<void> => {
console.log("**** bot mentioned");
console.log(`**** bot mentioned ${event.text}`);
const threadTs = event.ts;
if (event.text.match(VERSION_REGEX) !== null) {
await say({
Expand Down

0 comments on commit a99870a

Please sign in to comment.