static events = [ postbackEventType.shot, postbackEventType.shoted, postbackEventType.dead, postbackEventType.undo, postbackEventType.switch ] async execute(postback: any, supabase: any, user: any, lineBotClient: any) { let game = new Game(...) if( game.status() === gameStatus.Done && // ήʔϜ͕ऴ͍ྃͯ͠Δ߹มߋͰ͖ͳ͍ postback.t !== postbackEventType.undo // ͨͩɺ undo Մೳ ) { return [{type: "text", text: "ήʔϜ͕ऴ͍ྃͯ͠·͢"}] } switch(postback.t) { case postbackEventType.shot: game.shot(postback.ball); break; case postbackEventType.dead: game.dead(); break; case postbackEventType.undo: game.undo(); break; case postbackEventType.switch: game.switch(); break; } await supabase.from('games').update({ score: game.scores, status: game.status() }).eq('id', user.current_game_id).select() ... return replyMessages } } w (BNF&WFOUͰঢ়ଶΛߋ৽ w JT5BSHFUͰར༻͢Δ
FWFOUTΛఆٛ w &YFDVUFͷதͰɺΠϕϯτ͝ͱʹ
ॲཧΛมߋ w ઌ΄Ͳͷ(BNFDMBTTͷॲཧΛ
࣮ߦͯ͠σʔλΛߋ৽͢Δ