diff options
author | Evgeny Zinoviev <me@ch1p.io> | 2024-02-20 00:56:00 +0300 |
---|---|---|
committer | Evgeny Zinoviev <me@ch1p.io> | 2024-02-20 00:56:00 +0300 |
commit | 95ac1f0d6786d6f4331cfc8387ef816c1db24618 (patch) | |
tree | 67e9c963ae7686eb46c75699b31ccd5385bacf77 /localwebsite/classes | |
parent | 952e41d59412f5aad5898d0bccb3af800d104f24 (diff) |
comletely delete old lws, rewrite vk_sms_checker on python
Diffstat (limited to 'localwebsite/classes')
-rw-r--r-- | localwebsite/classes/TelegramBotClient.php | 37 |
1 files changed, 0 insertions, 37 deletions
diff --git a/localwebsite/classes/TelegramBotClient.php b/localwebsite/classes/TelegramBotClient.php deleted file mode 100644 index b9583ee..0000000 --- a/localwebsite/classes/TelegramBotClient.php +++ /dev/null @@ -1,37 +0,0 @@ -<?php - -class TelegramBotClient { - - protected string $token; - - public function __construct(string $token) { - $this->token = $token; - } - - public function sendMessage(int $chat_id, string $text): bool { - $ch = curl_init(); - $url = 'https://api.telegram.org/bot'.$this->token.'/sendMessage'; - curl_setopt($ch, CURLOPT_URL, $url); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_CONNECTTIMEOUT, 10); - curl_setopt($ch, CURLOPT_TIMEOUT, 10); - curl_setopt($ch, CURLOPT_POSTFIELDS, [ - 'chat_id' => $chat_id, - 'text' => $text, - 'parse_mode' => 'html', - 'disable_web_page_preview' => 1 - ]); - $body = curl_exec($ch); - curl_close($ch); - - $resp = jsonDecode($body); - if (!$resp['ok']) { - debugError(__METHOD__ . ': ' . $body); - return false; - } - - return true; - } - -}
\ No newline at end of file |