You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Malio/app/Utils/Telegram.php

32 lines
699 B
PHP

<?php
namespace App\Utils;
use App\Services\Config;
class Telegram
{
/**
* ·¢ËÍÏûÏ¢
*/
public static function Send($messageText)
{
if (Config::get('enable_telegram') == 'true') {
$bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
$bot->sendMessage(Config::get('telegram_chatid'), $messageText);
}
}
public static function SendMarkdown($messageText)
{
if (Config::get('enable_telegram') == 'true') {
$bot = new \TelegramBot\Api\BotApi(Config::get('telegram_token'));
$bot->sendMessage(Config::get('telegram_chatid'), $messageText, "Markdown");
}
}
}