Created
May 29, 2019 07:26
-
-
Save jirawatee/9946a304b77114babc3374e10b184258 to your computer and use it in GitHub Desktop.
UCL - Reply latest score
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
} else { | |
// [8.1] | |
// Firebase Realtime Database | |
let latest = await admin.database().ref('ucl/score').once('value') | |
reply(event.replyToken, { type: 'text', text: latest.val() }) | |
// Cloud Firestore | |
/* | |
let latest = await admin.firestore().doc('ucl/final').get() | |
reply(event.replyToken, {type:'text', text:latest.data().score}) | |
*/ | |
} | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment