webhook网址以设置webhookurl
https://api.telegram.org/botYOUR-TOKEN/setwebhook?url=https://58.222.100.41/pm
当我想用php将我的机器人连接到我的项目时,如何设置webhook。
注意!!!!我的域网址就像85.255.100.41/pm
我在php中的代码是:
include("Tel/Telegram.php");
date_default_timezone_set("asia/tehran");
// Set the bot TOKEN
$bot_id = "689393892:*****";
// Instances the class
$telegram = new Telegram($bot_id);
$text = $telegram->Text();
$username = $telegram->Username();
$name = $telegram->FirstName();
$family = $telegram->LastName();
$message_id = $telegram->MessageID();
$user_id = $telegram->UserID();
$chat_id = $telegram->ChatID();
if(!is_null($text) && !is_null($chat_id)){$content = array('chat_id' => $chat_id, 'text' => $user_id);
$telegram->sendMessage($content);
}