简体   繁体   English

Whatsapp Bot 使用 firebase

[英]Whatsapp Bot using firebase

I am creating a whatsapp bot that requires data from Firebase, I am not using html file, just node and I fun my app in the terminal so I need to have something like: const Firebase=require('Firebase')我正在创建一个需要来自 Firebase 的数据的 whatsapp 机器人,我没有使用 html 文件,只是节点,我在终端中玩我的应用程序,所以我需要类似: const Firebase=require('Firebase')

try something like here Also you have to install firebase (npm install firebase)尝试类似这里的东西你还必须安装 firebase (npm install firebase)

const firebase = require('firebase')

var firebaseConfig = {
    apiKey: "",
    authDomain: "",
    databaseURL: "",
    projectId: "",
    storageBucket: "",
    messagingSenderId: "",
    appId: ""
}

firebase.initializeApp(firebaseConfig)
let database = firebase.database()


let obj = {
    name: "yourName",
    message: "message"
}

// write data
database.ref("customPath").set(obj, function(error) {
    if (error) {
        console.log("Failed with error: " + error)
    } else {
        console.log("success")
    }
})

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 有没有办法删除或更新用户发送给 Twilio Bot 的 Whatsapp 消息? - Is there a way to delete or update Whatsapp message sent by the User to Twilio Bot? 如何在没有内容提供程序的情况下将自定义 WhatsApp 贴纸从 firebase 添加到 WhatsApp? - How to add a Customized WhatsApp Sticker from firebase into WhatsApp without Content Provider? Whatsapp 喜欢在线/离线状态与 firebase 反应本机 - Whatsapp like online/offline status in react native with firebase 如何使用 twillio 为 whatsapp 实现列表消息 - How to implement List message for whatsapp using twillio 使用 Twilio 解码传入 WhatsApp 消息的问题 - Problem With decoding an Incoming WhatsApp message using Twilio 如何使用 Twilio 为 whatsapp 创建列表消息 - How to create a List message for whatsapp using Twilio 使用 Firebase 登录 Google - 获取机器人帐户 - Google Signin with Firebase - Getting bot accounts 如何使用 twilio 在 whatsapp 上发送位置 object? - How to send the location object on whatsapp using twilio? 如何使用 Dialogflow 的 Twilio 接收 WhatsApp 音频消息 - How to Receive WhatsApp Audios Messages Using Twilio for Dialogflow whatsapp twilio 时,我还可以直接使用 Facebook Whatsapp api 吗? - while using whatsapp with twilio, can I still use Facebook Whatsapp api directly?
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM