Last active
May 27, 2019 20:05
-
-
Save jirawatee/5628def997af5a7748d6ce571d61ff14 to your computer and use it in GitHub Desktop.
Broadcast final score in UCL by Firebase Realtime Database
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
exports.finalScore = functions.region(region).pubsub | |
.schedule('02 of jun 04:00') | |
.timeZone('Asia/Bangkok') | |
.onRun(async context => { | |
// ดึงผลการแข่งขันล่าสุด | |
let result = await admin.database().ref('ucl/score').once('value'); | |
broadcast(`จบการแข่งขัน\n${result.val()}`); // ส่งข้อความหาทุกคนที่เป็น friend | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment