4
0
mirror of https://github.com/AzuraCast/AzuraCast.git synced 2024-06-17 14:37:07 +00:00

Allow selection of PWRTelegram API

This commit is contained in:
Buster "Silver Eagle" Neece 2018-08-12 20:29:39 -05:00
parent a0f9ce103c
commit 48301555f8
2 changed files with 22 additions and 1 deletions

View File

@ -40,6 +40,21 @@ return [
]
],
'api' => [
'radio',
[
'label' => __('Telegram API Selection'),
'description' => __('Choose which API service to connect to. The primary Telegram API is recommended for most cases, unless it is restricted in your area.'),
'belongsTo' => 'config',
'required' => true,
'default' => 'telegram',
'options' => [
'telegram' => __('Primary Telegram API (Recommended)'),
'pwrtelegram' => __('PWRTelegram API'),
]
]
],
'triggers' => [
'multiCheckbox',
[

View File

@ -26,8 +26,14 @@ class Telegram extends AbstractConnector
return;
}
$api_urls = [
'telegram' => 'https://api.telegram.org/',
'pwrtelegram' => 'https://api.pwrtelegram.xyz/',
];
$api = $config['api'] ?? 'telegram';
$client = new \GuzzleHttp\Client([
'base_uri' => 'https://api.telegram.org/', // bot<bot_token>/sendMessage?chat_id=-1001433&text=LIVE',
'base_uri' => $api_urls[$api],
'http_errors' => false,
'timeout' => 4.0,
]);