feat: bot
This commit is contained in:
@@ -10,6 +10,7 @@ class SettingsService
|
||||
{
|
||||
public const KEYS = [
|
||||
'telegram.bot_token',
|
||||
'telegram.bot_username',
|
||||
'telegram.owner_chat_id',
|
||||
'channels.max_per_agent',
|
||||
'channels.domains',
|
||||
@@ -73,6 +74,10 @@ class SettingsService
|
||||
'nutgram.token' => $bot,
|
||||
]);
|
||||
}
|
||||
$botName = $map['telegram.bot_username'] ?? null;
|
||||
if ($botName !== null) {
|
||||
config(['coruna.telegram.bot_username' => $botName]);
|
||||
}
|
||||
$chat = $map['telegram.owner_chat_id'] ?? null;
|
||||
if ($chat !== null && $chat !== '') {
|
||||
config(['coruna.telegram.owner_chat_id' => $chat]);
|
||||
@@ -110,6 +115,7 @@ class SettingsService
|
||||
|
||||
return [
|
||||
'telegram.bot_token' => (string) (config('coruna.telegram.bot_token') ?: ''),
|
||||
'telegram.bot_username' => (string) (config('coruna.telegram.bot_username') ?: ''),
|
||||
'telegram.owner_chat_id' => (string) (config('coruna.telegram.owner_chat_id') ?: ''),
|
||||
'channels.max_per_agent' => (string) (int) config('coruna.channels.max_per_agent', 5),
|
||||
'channels.domains' => is_array($domains) ? implode("\n", $domains) : '',
|
||||
|
||||
Reference in New Issue
Block a user