![](/img/trans.png)
[英]Telegram Bot - how to automate a response when deteched specific message from a user?
[英]How to download an audio message from a user in a telegram bot?
一天中的昂贵时间。 有一个问题。 我想制作一个能够读取用户语音消息并将其下载到服务器的电报机器人。 问题是,如何让机器人自动理解音频被发送到它并保存到指定目录? PS试过了
bot.on('voice', (msg)=>{
bot.getFile(msg.voice.file_id, () => {
bot.getFile(voiceId).then((resp) => {
{
file_id = 'file_id',
file_size = 6666,
file_path = 'file_path'
}
bot.getFileLink(voiceId).then((resp) => {
'https://api.telegram.org/file/bot<BOT_TOKEN>/<file_path>'
});
});
});
但文件只下载了我指定的 id 和路径
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.