Search code examples
telegram-botphp-telegram-bottelegram-webhook

Telegram Bot getChat method on channels using integer id returns old details


we have a web application,user add our bot in his/her channel as admin ,and can do some stuff from web app(e.g posting/editing items with markup buttons..etc),our app is heavily based on channel integer chat_id (example: chat_id=-1001006616144) instead of (@username ),everything works fine...the problem is :

when the channel owner change the channel username (e.g @foo to @bar) ,the robots getChat method still returns the old channel's username (@foo) IF i pass the channels integer id (e.g: -1001006616144) ,although there is no channel with username @foo anymore

but this does not apply for changing channels title,i mean if the owner change the channels title,the getChat (with integer id as parameter ) method instantly returns the updated channels title (and username)

i need to use the integer chat_id because its constant during the lifetime of channel until its get deleted and my web app needs the updated @username and title as long as my robot is Administrator in the channel
is it some sort of bug?can anyone suggest a workaround for this so i can get the updated channels info (at maximum 12 hours intervals)?im using PHP BTW


Solution

  • This seems to be a problem with the Telegram Bot API itself. You must understand that the HTTP API your are talking to (api.telegram.org) ist just a proxy-like interface and is a regulat Telegram client too (just with a bot, not a user logged in). It is possible that the caching used there messed this up. You should contact @BotSupport about this.

    A workaround for this might be to use the unofficial PWRTelegram API. It can't guarantee the same uptime the official api has, but comes along with some cracy features.