Last active
May 25, 2020 08:35
-
-
Save jirawatee/528544fe9bbdd68cca07c0ba9207fdd0 to your computer and use it in GitHub Desktop.
Resize image by Firebase Extension - 1
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.uploadPhoto = functions.https.onRequest(async (req, res) => { | |
let event = req.body.events[0] | |
if (event.type === 'message' && event.message.type === 'image') { | |
// เรียกฟังก์ชัน upload เมื่อเข้าเงื่อนไข | |
let urls = await upload(event) | |
// reply ตัว URL ที่ได้กลับไปยังห้องแชท | |
await reply(event.replyToken, { type: "text", text: urls }) | |
} | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment