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:
parent
a0f9ce103c
commit
48301555f8
|
@ -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',
|
||||
[
|
||||
|
|
|
@ -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,
|
||||
]);
|
||||
|
|
Loading…
Reference in New Issue
Block a user