Created
December 12, 2022 15:46
-
-
Save PamornT/48083949e25ed760366261864a291668 to your computer and use it in GitHub Desktop.
This file contains 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
import * as functions from "firebase-functions"; | |
// // Start writing Firebase Functions | |
// // https://firebase.google.com/docs/functions/typescript | |
// | |
export const webHook = functions.https.onRequest((request, response) => { | |
console.log(request.body); | |
const events = request.body.events; | |
events.forEach( async (event: any) => { | |
console.log(event); | |
if (event.type === "message") { | |
// Detect Intent | |
// Reply | |
} | |
}); | |
response.end(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment