テレグラムにチャンネルを作成しましたが、チャンネルの管理者としてボットを追加しました。ボットが応答しないチャンネルにメッセージを送信すると、なぜですか?電報ボットはチャネルのメッセージに応答しませんか?
私は
https://api.telegram.org/bot[key]/[email protected]&text=Thisテキストはボットからチャネルにある/のSendMessageでメッセージを送信することができます。 https://github.com/Eleirbag89/TelegramBotPHP
を、これはボットのための簡単なテストコードです:
私が使用しています
<?php
include 'connection.php';
include("Telegram.php");
define('bot_id', '227493781:AAE2x0l3BRrjGN3S8wMVo9zOTYbbwr8');
$telegram = new Telegram(bot_id);
$text = $telegram->Text();
$chat_id = $telegram->ChatID();
if ($text == "call") {
$content = array('chat_id' => $chat_id, 'text' => "This is test message!!!");
$telegram->sendMessage($content);
}
?>
'@ BotFather'に'/setprivacy'を設定しましたか? – Maak
はい、私はプライバシーを有効にしました。ボットはチャンネルの管理者の一人です。ボットはグループチャットで応答していますが、チャットでは応答しません。 – Patzu