Skip to content

Commit

Permalink
[fix] Change reminder condition (#25)
Browse files Browse the repository at this point in the history
  • Loading branch information
hi-se committed Jul 30, 2021
1 parent 38409a7 commit e390a12
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/shujinosuke.ts
Expand Up @@ -107,6 +107,13 @@ const sendReminderForEndSession = () => {
const client = getSlackClient();
const sessionChannelId = getSessionChannelId();
const channelState = getChannelState(sessionChannelId);
if (!channelState?.waiting.length && !channelState?.done.length) {
abortSession(sessionChannelId);
client.chat.postMessage({
channel: sessionChannelId,
text: `:fast_forward: 終了します。`
})
}
if (channelState?.waiting.length) {
client.chat.postMessage({
channel: sessionChannelId,
Expand All @@ -115,12 +122,6 @@ const sendReminderForEndSession = () => {
`:question: 私がちゃんと反応しなかった場合、削除して投稿し直してみてください。`
)
})
} else {
abortSession(sessionChannelId);
client.chat.postMessage({
channel: sessionChannelId,
text: `:fast_forward: 終了します。`
})
}
}

Expand Down

0 comments on commit e390a12

Please sign in to comment.