Created
May 27, 2019 20:15
-
-
Save jirawatee/7a7a1c0d87115d85f907d0cb17e5f745 to your computer and use it in GitHub Desktop.
Broadcast final score in UCL by Cloud Firestore
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 => { | |
// ดึงผลการแข่งขันล่าสุดจาก Firestore | |
let result = await admin.firestore().doc('ucl/final').get() | |
broadcast(`จบการแข่งขัน\n${result.data().score}`); // ส่งข้อความให่ทุกคนที่เป็น friend | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment