feat: bot

This commit is contained in:
hashbro
2026-08-15 23:05:51 +08:00
parent 9049fdccad
commit 376b442880
26 changed files with 944 additions and 352 deletions
+6
View File
@@ -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) : '',