Skip to content

Commit

Permalink
Merge pull request #37 from mahdyaslami/patch-1
Browse files Browse the repository at this point in the history
Add telegram api host to config
  • Loading branch information
grkamil authored Jun 14, 2023
2 parents 7f457d3 + 81de827 commit d20f246
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions config/telegram-logger.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
// Proxy server
'proxy' => env('TELEGRAM_LOGGER_PROXY', ''),

// Telegram API host without trailling slash
'api_host' => env('TELEGRAM_LOGGER_API_HOST', 'https://api.telegram.org'),

// Telegram sendMessage options: https://core.telegram.org/bots/api#sendmessage
'options' => [
// 'parse_mode' => 'html',
Expand Down
4 changes: 3 additions & 1 deletion src/TelegramHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ private function sendMessage(string $text): void
config('telegram-logger.options', [])
));

$url = 'https://api.telegram.org/bot' . $this->botToken . '/sendMessage?' . $httpQuery;
$host = $this->getConfigValue('api_host');

$url = $host . '/bot' . $this->botToken . '/sendMessage?' . $httpQuery;

$proxy = $this->getConfigValue('proxy');

Expand Down

0 comments on commit d20f246

Please sign in to comment.