Hey guys I save file_id on my db and after

some days the bot responds with
wrong file identifier/http url specified when I try to download it

Any idea why this is happening?

17 ответов

21 просмотр

file_ids are not persistent according to bot api docs. And are you sure that you are calling getFile first to download it? Because for me it returns Bad Request: invalid file_id for wrong ids

s0m31 🇷🇺
file_ids are not persistent according to bot api d...

file IDs are persistent according to the bot API docs: https://core.telegram.org/bots/faq#can-i-count-on-file-ids-to-be-persistent

Nick
file IDs are persistent according to the bot API d...

well i just couldnt find that phrase on this point

https://t.me/c/1279877202/22875 https://t.me/c/1279877202/22887

Воспоминания <last name><a href=></a>
https://t.me/c/1279877202/22875 https://t.me/c/127...

stop linking messages using chat id pleaseeeee. Nobody can open em except you

Воспоминания <last name><a href=></a>
https://t.me/c/1279877202/22875 https://t.me/c/127...

I know that this is tdlib chat, so I have to search it in global first, open it, and only then I can open your links. If you like mtproto so much, heres probably a detailed explanation why it happens. You are linking a message in a group, so telegram attempts using this to get info about the conversation. But the error 406 (CHANNEL_PRIVATE) triggers. And in description of this error nothing is stated about channel being private or not. Its just "You haven't joined this channel/supergroup.". Why can this happen? Because a non-member of tdlib chat does not have access hash for it. So it can't use this constructor of input channel. And therefore method throws 406 because it is missing. Why linking with username works? Because of resolveUsername. And it provides a vector of chats. And channel is also one of the constructors of a chat. So it extracts access_hash from resolving username and now can get the message via channel id. The global search feature works for the same reason: it just stores access hash after peer was resolved. So please don't limit such replies to people who had joined tdlibchat

Воспоминания <last name><a href=></a>
I have my reasons to use without usernames.

But people just can't access it. Use it in the same chat as many times as you want, but if you want to link it in another one - use usernames. Otherwise such links are nothing more than a useless text

Yohannes- Автор вопроса
Воспоминания <last name><a href=></a>
https://t.me/c/1279877202/22875 https://t.me/c/127...

you always send links to inaccessible chat why, even ibn your github links i've seen that

Yohannes
you always send links to inaccessible chat why, ev...

There are users / bots which crawl public chats searching for @username mentions in the chat, which I don't like, Hence I try to use links without usernames in my messages.

Yohannes- Автор вопроса

It's curious, bc i am not in the tdlib channel, but tg opens the message for me and i can see it. It may works bc i was once in the channel?

AdelaFoofur82 🛸
It's curious, bc i am not in the tdlib channel, bu...

Did you open it before tapping this link? Telegram stores hashes in list, so opening it once would get the link working until restart

AdelaFoofur82 🛸
It's curious, bc i am not in the tdlib channel, bu...

Probably ypur cloent stored the access hash and the group info of that group in cache

Похожие вопросы

Карта сайта