Featured image of post telegram send message api

telegram send message api

這裡會在成功新增文章的時候執行,讓有訂閱TG官方帳號可以接收到這樣 格式 的訊息。

$url = 'https://api.telegram.org/bot{TOKEN}/sendMessage?chat_id=@toolmanxyz&parse_mode=HTML&text=Hello, World!';        
$client = new \GuzzleHttp\Client();
$request = new \GuzzleHttp\Psr7\Request('POST', $url);
$promise = $client->sendAsync($request)->then(function ($response) {
	//
});
$promise->wait();

 

Licensed under CC BY-NC-SA 4.0