Is it possible to send a message to a public Telegram channel by API as admin? I mean is it possible to send e.g. a video to a public Telegram channel by using e.g. php?
We offer two kinds of APIs for developers. The Bot API allows you to easily create programs that use Telegram messages for an interface. The Telegram API and TDLib allow you to build your own customized Telegram clients.
If you have already connected bots, go to the "Manage bots" section, and click Add bot. You can also click "Connect" next to the channel. In the "Telegram" section enter your token from the necessary bot and click “Connect.” In the next window click the “Subscribe” button.
You can create a telegram bot and add it to your channel as admin. Then use @yourchannel as chat_id in your telegram bot for sending messages to your channel. As an example in php:
<?php
$botToken = "yourbottoken";
$chat_id = "@yourchannel";
$message = "your message";
$bot_url = "https://api.telegram.org/bot$botToken/";
$url = $bot_url."sendMessage?chat_id=".$chat_id."&text=".urlencode($message);
file_get_contents($url);
?>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With