Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
812 stars 342 forks source link

$telegram->getUpdateType()=='channel_post' not receiving channel updates #265

Closed alil0rd closed 2 years ago

alil0rd commented 2 years ago

I have an issue with receiving channel updates. I tried this: $telegram->getUpdateType()=='channel_post' ` file_put_contents($mainpath.'channel.txt', print_r($telegram->getUpdateType(), TRUE)); $logfile = new CURLFile(realpath($mainpath.'channel.txt'));

$content = ['chat_id' => $someone, "document" => $logfile, ]; $telegram->sendDocument($content); ` but I notice that no updates are sent to the bot! I tried also this:

` $result = $telegram->getData(); file_put_contents($mainpath.'channel.txt', print_r($result , TRUE)); $logfile = new CURLFile(realpath($mainpath.'channel.txt'));

$content = ['chat_id' => $someone, "document" => $logfile, ]; $telegram->sendDocument($content); ` but I didn't receive any updates from channels! Am I wrong in my code? I want to find out when a channel send a post, like when a post is sent to the supergroup and the bot get an update.

alil0rd commented 2 years ago

Solved: I have always tried on private channels! try on a public one.