39 lines
1.1 KiB
PHP
39 lines
1.1 KiB
PHP
<?php
|
|
/**
|
|
* 2012-2017 Azelab
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* This source file is subject to the Academic Free License (AFL 3.0)
|
|
* that is bundled with this package in the file LICENSE.txt.
|
|
* It is also available through the world-wide-web at this URL:
|
|
* http://opensource.org/licenses/afl-3.0.php
|
|
* If you did not receive a copy of the license and are unable to
|
|
* obtain it through the world-wide-web, please send an email
|
|
* to license@areama.net so we can send you a copy immediately.
|
|
*
|
|
* @author Azelab <support@azelab.com>
|
|
* @copyright 2017 Azelab
|
|
* @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0)
|
|
* International Registered Trademark & Property of Azelab
|
|
*/
|
|
|
|
class ArContactUsTelegram
|
|
{
|
|
protected $token;
|
|
protected $chat_id;
|
|
|
|
|
|
public function __construct($token, $chat_id)
|
|
{
|
|
$this->token = $token;
|
|
$this->chat_id = $chat_id;
|
|
}
|
|
|
|
public function send($message)
|
|
{
|
|
$url = 'https://api.telegram.org/bot'. $this->token .'/sendMessage?chat_id='. $this->chat_id .'&text=' . urlencode($message);
|
|
return Tools::file_get_contents($url);
|
|
}
|
|
}
|