for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace TelegramHandler;
use Telegram\Bot\Api as TelegramBotApi;
/**
* TelegramAdapter
*
* @author Renan Melo <[email protected]>
* @author Rafael Nery <[email protected]>
* @see AbstractProcessingHandler
*/
class TelegramAdapter
{
private $telegram;
private $chat_id;
public function __construct($token, $chatId)
$this->telegram = new TelegramBotApi($token);
$this->chat_id = $chatId;
return $this;
}
public function sendMessage($message)
return $this->telegram->sendMessage([
'chat_id' => $this->chat_id,
'text' => $message,
'parse_mode' => 'HTML'
]);