X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FConsole%2FCommands%2FDiscordBotCommand.php;h=9aa29ae59619e5a32bd4f5f711e211e47b85b0bd;hb=b20f23e77c13fe6c9e73bfd21f042b66efd56a30;hp=4368bb5b1d4b06d2bc815c74ff35d470cf708d95;hpb=12f64085fd212a9744db01790cefad53c970e8d9;p=alttp.git diff --git a/app/Console/Commands/DiscordBotCommand.php b/app/Console/Commands/DiscordBotCommand.php index 4368bb5..9aa29ae 100644 --- a/app/Console/Commands/DiscordBotCommand.php +++ b/app/Console/Commands/DiscordBotCommand.php @@ -2,6 +2,7 @@ namespace App\Console\Commands; +use App\DiscordAppCommands\AosrPresetCommand; use App\Models\DiscordBotCommand as CommandModel; use App\Models\DiscordChannel; use App\Models\DiscordGuild; @@ -63,6 +64,13 @@ class DiscordBotCommand extends Command } } }); + + if (config('discord.enable_commands')) { + AosrPresetCommand::listen($discord); + } + if (config('discord.create_commands')) { + AosrPresetCommand::create($discord); + } }); $discord->on(Event::GUILD_CREATE, function (Guild $guild, Discord $discord) { try { @@ -80,21 +88,21 @@ class DiscordBotCommand extends Command }); $discord->on(Event::CHANNEL_CREATE, function (Channel $channel, Discord $discord) { try { - DiscordGuild::onUpstreamCreate($channel); + DiscordChannel::onUpstreamCreate($channel); } catch (\Exception $e) { $this->error('channel create: '.$e->getMessage()); } }); $discord->on(Event::CHANNEL_UPDATE, function (Channel $channel, Discord $discord, ?Channel $old) { try { - DiscordGuild::onUpstreamUpdate($channel); + DiscordChannel::onUpstreamUpdate($channel); } catch (\Exception $e) { $this->error('channel update: '.$e->getMessage()); } }); $discord->on(Event::CHANNEL_DELETE, function ($channel, Discord $discord) { try { - DiscordGuild::onUpstreamDelete($channel); + DiscordChannel::onUpstreamDelete($channel); } catch (\Exception $e) { $this->error('channel delete: '.$e->getMessage()); }