Skip to content

Instantly share code, notes, and snippets.

@PamornT
Last active May 30, 2022 04:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save PamornT/da88ce3dbc5c1cb6e8bb129078936d90 to your computer and use it in GitHub Desktop.
Save PamornT/da88ce3dbc5c1cb6e8bb129078936d90 to your computer and use it in GitHub Desktop.
const savePointVideoComplete = async(event) => {
const replyToken = event.replyToken
let messages = ''
const pointExists = await checkPointExists(event)
if (pointExists) {
messages = [{ 'type': 'text', 'text': '🎉 ขอบคุณที่รับชมวีดีโอ คุณเคยได้รับคะแนนกิจกรรมนี้ไปแล้ว 🎉' }]
} else {
await collectPoint(event)
messages = [{ 'type': 'text', 'text': '🎉 ขอบคุณที่รับชมวีดีโอ รับคะแนนไปเลย 10 คะแนน 🎉' }]
}
await reply(replyToken, messages)
return true
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment