是否可以以管理员身份通过 API 向公共(public) Telegram channel 发送消息? 我的意思是可以发送例如通过使用例如将视频发送到公共(public)电报 channel PHP?
最佳答案
您可以创建电报机器人并将其作为管理员添加到您的 channel 。 然后在电报机器人中使用@yourchannel 作为 chat_id 将消息发送到您的 channel 。 以 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);
?>
关于php - 如何通过 php 向公共(public)电报 channel 发送消息?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34588463/