Bug Report
I have read:
I am using the latest version of the library.
const options = {
title: 'title',
performer: 'performer'
};
bot.sendAudio(chatId, url, options)
{
"message_id": ...,
"from": { ... },
"chat": { ... },
"date": ... ,
"audio": {
"duration": ...,
"mime_type": "audio/mpeg",
"title": "title",
"performer": "performer",
"file_id": "...",
"file_size": ...
}
}
{
"message_id": ...,
"from": { ... },
"chat": { ... },
"date": ...,
"audio": {
"duration": ...,
"mime_type": "audio/mpeg",
"file_id": "...",
"file_size": ...
}
}
As the code written.
So apparently it works depending on the value of the audio parameter (2nd parameter) in TelegramBot#sendAudio(). If I use a local file, it seems to work just fine. But using a HTTP URL does not work. Could you try reproducing my observation?
This is something you should report to Telegram Bot Support. Please keep us updated.
@GochoMugo just like you said.
When second parameter is URL or file_id , the options does not work as expected.
Thanks for replying .
@hufan-Akari Did you contact Bot support?
@GochoMugo Yes, but they think it behaves as intended.
When the audio is a file_id, it means that the audio is already uploaded to Telegram servers, so it is not modified. This cuase that the actual performer and title is taken from the file itself, not from the request.
In case of URL the title and performer is taken from the URL too, not from the actual request.
I'm trying to ask the chance to modify the performer and title when the sent audio is URL .
-- When the audio is file_id, the current behavior is okay, we should not to modify it. But the url is another thing.To modify it, we have to download it and upload it again. Is there any more effective method to do it?
We will take that information when using urls from the Twitter Cards (https://dev.twitter.com/cards/overview) or Open Graph (http://ogp.me/)
If you change them, we should take it from there.
What does it mean ?
We will take that information when using urls from the Twitter Cards (https://dev.twitter.com/cards/overview) or Open Graph (http://ogp.me/)
They retrieve metadata of the object residing at the submitted URL (using the mentioned protocols).
If you change them, we should take it from there
This statement is rather ambiguous. I think they want you to change the metadata at the original URL.
@GochoMugo Sorry for that.
English is not my first language. I didn't make myself understood.
Could you report this issue to Telegram Bot Support ?
Just shot the query their way. Let's wait and see...
The API does not allow one to specify the attributes of the object, if they can be retrieved from the remote source (when using URL) or the file (when using file_id).
Imagine if you could specify the incorrect (read: fabricated) attributes when using URLs. It would open Telegram users to click-bait shenanigans.
The current behavior cannot avoid the _click-bait shenanigans_, you can download the file from remote source and upload to Telegram server if you want to modify it.
The fact is some metadata missed and I need to correct it.
The workaround is just as said before, download and upload. It is not effective.

The API should bring convenience to people rather than assume that the developer is evil.
As mentioned earlier, this is a limitation/restriction set by Telegram Bot API itself (not the library).