Skip to content

Commit d20f246

Browse files
authored
Merge pull request #37 from mahdyaslami/patch-1
Add telegram api host to config
2 parents 7f457d3 + 81de827 commit d20f246

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

config/telegram-logger.php

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
// Proxy server
1414
'proxy' => env('TELEGRAM_LOGGER_PROXY', ''),
1515

16+
// Telegram API host without trailling slash
17+
'api_host' => env('TELEGRAM_LOGGER_API_HOST', 'https://api.telegram.org'),
18+
1619
// Telegram sendMessage options: https://core.telegram.org/bots/api#sendmessage
1720
'options' => [
1821
// 'parse_mode' => 'html',

src/TelegramHandler.php

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,9 @@ private function sendMessage(string $text): void
140140
config('telegram-logger.options', [])
141141
));
142142

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

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

0 commit comments

Comments
 (0)