我正在尝试将 Telegraf 库与 Firebase 函数一起使用,但它没有按我预期的那样工作。
我遵循这些本文和webhooks 中出现的说明(如快速示例所示)和webhookcallback中出现的 Telegraf 文档。
const Telegraf = require('telegraf')
// The Cloud Functions for Firebase SDK to create Cloud Functions and setup triggers.
const functions = require('firebase-functions')
// The Firebase Admin SDK to access the Firebase Realtime or Firestore Database.
const admin = require('firebase-admin')
// set telegraf and responses.
const BOT_TOKEN = 'my-telegram-bot-token'
const bot = new Telegraf(BOT_TOKEN)
bot.start((ctx) => ctx.reply("Start instructions"))
bot.help((ctx) => ctx.reply("This is help"))
bot.hears('hi', …Run Code Online (Sandbox Code Playgroud)