Skip to content

Commit

Permalink
Add decline response
Browse files Browse the repository at this point in the history
  • Loading branch information
hinryd committed May 7, 2021
1 parent f56aec9 commit 800aaa0
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/bot/responseHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,12 @@ const responseHandler = async (ctx: ResCtx) => {
append: 1,
})
break
case 'no':
await supabase.from('responses').delete().match({
event_id,
user_id: id,
})
break
case 'del':
await supabase.from('events').delete().match({ event_id })
return ctx.editMessageText(`Event ${event_id} has been deleted`)
Expand Down Expand Up @@ -90,6 +96,7 @@ const responseHandler = async (ctx: ResCtx) => {
Markup.inlineKeyboard([
Markup.button.callback('yes', `yes:${eventData.data[0].event_id}`),
Markup.button.callback('maybe', `maybe:${eventData.data[0].event_id}`),
Markup.button.callback('no', `no:${eventData.data[0].event_id}`),
// Markup.button.callback('+1', `addOne:${eventData.data[0].event_id}`),
])
)
Expand Down
1 change: 1 addition & 0 deletions src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ const list = async (ctx: BotCtx) => {
Markup.inlineKeyboard([
Markup.button.callback('yes', `yes:${event.event_id}`),
Markup.button.callback('maybe', `maybe:${event.event_id}`),
Markup.button.callback('no', `no:${event.event_id}`),
// Markup.button.callback('+1', `addOne:${event.event_id}`),
])
)
Expand Down

0 comments on commit 800aaa0

Please sign in to comment.