How to send a message to the public Telegram channel via php?

Can I send a message to the public Telegram API channel as an administrator? I mean, is it possible to send, for example. video to a public Telegram channel using, for example, PHP?

+7
api php
source share
1 answer

You can create a telegram bot and add it to your channel as an administrator. Then use @yourchannel as chat_id in your telegram to send 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); ?> 
+24
source share

All Articles