This commit is contained in:
2026-05-06 19:36:53 +03:00
parent 43dd36e20e
commit 8b3a3964a5
10 changed files with 48 additions and 45 deletions
+3 -2
View File
@@ -4,7 +4,8 @@ namespace Lucent\Channel;
use Lucent\Channel\Data\UserCommand;
use Lucent\Primitive\Collection;
use Lucent\Schema\Schema;
use Lucent\Data\Schema;
use Lucent\Data\ChannelAuth;
final class Channel
{
@@ -18,6 +19,7 @@ final class Channel
*/
function __construct(
public string $name,
public ChannelAuth $auth,
public string $url,
public string $previewTarget,
public Collection $commands,
@@ -27,7 +29,6 @@ final class Channel
) {
$this->lucentUrl = $url . "/lucent";
$this->filesUrl = $this->makeFilesUrl();
$this->previewTargetUrl = $url . "/" . $previewTarget;
}
+5
View File
@@ -3,6 +3,7 @@
namespace Lucent\Channel;
use Lucent\Channel\Data\UserCommand;
use Lucent\Data\ChannelAuth;
use Lucent\Primitive\Collection;
use Lucent\Data\Schema;
use Lucent\Schema\SchemaService;
@@ -34,6 +35,10 @@ final class ChannelService
$channel = new Channel(
name: config("lucent.name") ?? "",
auth: match (config("lucent.auth")) {
"lunar" => ChannelAuth::LUNAR,
default => ChannelAuth::LUCENT,
},
url: rtrim(config("lucent.url") ?? "", "/"),
previewTarget: rtrim(config("lucent.previewTarget") ?? "", "/"),
commands: Collection::make($userCommands),