我有一个电报机器人 webhook 消息,如
{
"update_id":236420475,
"message":{
"message_id":26577,
"from":{
"id":xxxxxxxx,
"first_name":"DB",
"last_name":"Ks",
"username":"xxxxxxxx"
},
"chat":{
"id":193044649,
"first_name":"DB",
"last_name":"Ks",
"username":"xxxxxxxx",
"type":"private"
},
"date":1493266832,
"voice":{
"duration":2,
"mime_type":"audio/ogg",
"file_id":"AwADBQADBAADQKMIVC978KStO6ZhAg",
"file_size":7532
}
}
}
Run Code Online (Sandbox Code Playgroud)
从电报机器人 API 文档中,指定了用于下载文件的file_path。我怎样才能获得FILE_PATH或得到任何API FILE_PATH使用的file_id?
我想使用 Telegram Bots 将文件从 URL 发送给用户,我的文件扩展名在,.attheme但我无法从 Url 上传此文件。
目前我可以上传.zip, .pdf,但我想.attheme从 PHP 代码上传文件。
该机器人可以将任何类型的文件上传到 Telegram:@uploadbot
我怎样才能做到这一点 ?
我正在尝试将 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) 我有一个电报机器人,可以在群组中发送消息。我希望电报机器人不时更改其“名称” - 就像用户一样。这可能吗?这意味着当我看到来自机器人的消息时,它可以说“ABCbot”,但后来它可以说“DEFbot”。让我知道!
python-telegram-bot telegram-bot telegram-webhook node-telegram-bot-api