小编mol*_*vec的帖子

如何在 Firebase 中使用 Telegraf(电报)?

我正在尝试将 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)

firebase google-cloud-functions telegraf telegram-webhook

2
推荐指数
1
解决办法
1943
查看次数