From c9b617bdb11936be7eef7365face48a5861896ba Mon Sep 17 00:00:00 2001 From: QWp6t Date: Sat, 5 Oct 2024 13:24:20 -0700 Subject: [PATCH 1/2] =?UTF-8?q?=E2=9C=A8=20=20use=20laravel's=20event=20di?= =?UTF-8?q?spatcher=20for=20discord=20events?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationCommandPermissionsUpdate.php | 13 ++ .../Discord/AutoModerationActionExecution.php | 12 ++ .../Discord/AutoModerationRuleCreate.php | 12 ++ .../Discord/AutoModerationRuleDelete.php | 12 ++ .../Discord/AutoModerationRuleUpdate.php | 13 ++ src/Events/Discord/ChannelCreate.php | 12 ++ src/Events/Discord/ChannelDelete.php | 12 ++ src/Events/Discord/ChannelPinsUpdate.php | 12 ++ src/Events/Discord/ChannelUpdate.php | 13 ++ src/Events/Discord/ClientReady.php | 11 ++ src/Events/Discord/ClientReconnected.php | 11 ++ src/Events/Discord/ClientTrace.php | 12 ++ .../Discord/GuildAuditLogEntryCreate.php | 12 ++ src/Events/Discord/GuildBanAdd.php | 12 ++ src/Events/Discord/GuildBanRemove.php | 12 ++ src/Events/Discord/GuildCreate.php | 12 ++ src/Events/Discord/GuildDelete.php | 13 ++ src/Events/Discord/GuildEmojisUpdate.php | 13 ++ .../Discord/GuildIntegrationsUpdate.php | 12 ++ src/Events/Discord/GuildMemberAdd.php | 12 ++ src/Events/Discord/GuildMemberRemove.php | 12 ++ src/Events/Discord/GuildMemberUpdate.php | 13 ++ src/Events/Discord/GuildRoleCreate.php | 12 ++ src/Events/Discord/GuildRoleDelete.php | 12 ++ src/Events/Discord/GuildRoleUpdate.php | 13 ++ .../Discord/GuildScheduledEventCreate.php | 12 ++ .../Discord/GuildScheduledEventDelete.php | 12 ++ .../Discord/GuildScheduledEventUpdate.php | 13 ++ .../Discord/GuildScheduledEventUserAdd.php | 12 ++ .../Discord/GuildScheduledEventUserRemove.php | 12 ++ src/Events/Discord/GuildStickersUpdate.php | 13 ++ src/Events/Discord/GuildUpdate.php | 13 ++ src/Events/Discord/IntegrationCreate.php | 12 ++ src/Events/Discord/IntegrationDelete.php | 12 ++ src/Events/Discord/IntegrationUpdate.php | 13 ++ src/Events/Discord/InteractionCreate.php | 12 ++ src/Events/Discord/InviteCreate.php | 12 ++ src/Events/Discord/InviteDelete.php | 12 ++ src/Events/Discord/MessageCreate.php | 12 ++ src/Events/Discord/MessageDelete.php | 12 ++ src/Events/Discord/MessageDeleteBulk.php | 12 ++ src/Events/Discord/MessageReactionAdd.php | 12 ++ src/Events/Discord/MessageReactionRemove.php | 12 ++ .../Discord/MessageReactionRemoveAll.php | 12 ++ .../Discord/MessageReactionRemoveEmoji.php | 12 ++ src/Events/Discord/MessageUpdate.php | 13 ++ src/Events/Discord/PresenceUpdate.php | 12 ++ src/Events/Discord/StageInstanceCreate.php | 12 ++ src/Events/Discord/StageInstanceDelete.php | 12 ++ src/Events/Discord/StageInstanceUpdate.php | 13 ++ src/Events/Discord/ThreadCreate.php | 12 ++ src/Events/Discord/ThreadDelete.php | 12 ++ src/Events/Discord/ThreadListSync.php | 12 ++ src/Events/Discord/ThreadMemberUpdate.php | 12 ++ src/Events/Discord/ThreadMembersUpdate.php | 12 ++ src/Events/Discord/ThreadUpdate.php | 13 ++ src/Events/Discord/TypingStart.php | 12 ++ src/Events/Discord/UserUpdate.php | 13 ++ src/Events/Discord/VoiceServerUpdate.php | 12 ++ src/Events/Discord/VoiceStateUpdate.php | 13 ++ src/Events/Discord/WebhooksUpdate.php | 13 ++ src/Laracord.php | 131 +++++++++++++++++- 62 files changed, 876 insertions(+), 2 deletions(-) create mode 100644 src/Events/Discord/ApplicationCommandPermissionsUpdate.php create mode 100644 src/Events/Discord/AutoModerationActionExecution.php create mode 100644 src/Events/Discord/AutoModerationRuleCreate.php create mode 100644 src/Events/Discord/AutoModerationRuleDelete.php create mode 100644 src/Events/Discord/AutoModerationRuleUpdate.php create mode 100644 src/Events/Discord/ChannelCreate.php create mode 100644 src/Events/Discord/ChannelDelete.php create mode 100644 src/Events/Discord/ChannelPinsUpdate.php create mode 100644 src/Events/Discord/ChannelUpdate.php create mode 100644 src/Events/Discord/ClientReady.php create mode 100644 src/Events/Discord/ClientReconnected.php create mode 100644 src/Events/Discord/ClientTrace.php create mode 100644 src/Events/Discord/GuildAuditLogEntryCreate.php create mode 100644 src/Events/Discord/GuildBanAdd.php create mode 100644 src/Events/Discord/GuildBanRemove.php create mode 100644 src/Events/Discord/GuildCreate.php create mode 100644 src/Events/Discord/GuildDelete.php create mode 100644 src/Events/Discord/GuildEmojisUpdate.php create mode 100644 src/Events/Discord/GuildIntegrationsUpdate.php create mode 100644 src/Events/Discord/GuildMemberAdd.php create mode 100644 src/Events/Discord/GuildMemberRemove.php create mode 100644 src/Events/Discord/GuildMemberUpdate.php create mode 100644 src/Events/Discord/GuildRoleCreate.php create mode 100644 src/Events/Discord/GuildRoleDelete.php create mode 100644 src/Events/Discord/GuildRoleUpdate.php create mode 100644 src/Events/Discord/GuildScheduledEventCreate.php create mode 100644 src/Events/Discord/GuildScheduledEventDelete.php create mode 100644 src/Events/Discord/GuildScheduledEventUpdate.php create mode 100644 src/Events/Discord/GuildScheduledEventUserAdd.php create mode 100644 src/Events/Discord/GuildScheduledEventUserRemove.php create mode 100644 src/Events/Discord/GuildStickersUpdate.php create mode 100644 src/Events/Discord/GuildUpdate.php create mode 100644 src/Events/Discord/IntegrationCreate.php create mode 100644 src/Events/Discord/IntegrationDelete.php create mode 100644 src/Events/Discord/IntegrationUpdate.php create mode 100644 src/Events/Discord/InteractionCreate.php create mode 100644 src/Events/Discord/InviteCreate.php create mode 100644 src/Events/Discord/InviteDelete.php create mode 100644 src/Events/Discord/MessageCreate.php create mode 100644 src/Events/Discord/MessageDelete.php create mode 100644 src/Events/Discord/MessageDeleteBulk.php create mode 100644 src/Events/Discord/MessageReactionAdd.php create mode 100644 src/Events/Discord/MessageReactionRemove.php create mode 100644 src/Events/Discord/MessageReactionRemoveAll.php create mode 100644 src/Events/Discord/MessageReactionRemoveEmoji.php create mode 100644 src/Events/Discord/MessageUpdate.php create mode 100644 src/Events/Discord/PresenceUpdate.php create mode 100644 src/Events/Discord/StageInstanceCreate.php create mode 100644 src/Events/Discord/StageInstanceDelete.php create mode 100644 src/Events/Discord/StageInstanceUpdate.php create mode 100644 src/Events/Discord/ThreadCreate.php create mode 100644 src/Events/Discord/ThreadDelete.php create mode 100644 src/Events/Discord/ThreadListSync.php create mode 100644 src/Events/Discord/ThreadMemberUpdate.php create mode 100644 src/Events/Discord/ThreadMembersUpdate.php create mode 100644 src/Events/Discord/ThreadUpdate.php create mode 100644 src/Events/Discord/TypingStart.php create mode 100644 src/Events/Discord/UserUpdate.php create mode 100644 src/Events/Discord/VoiceServerUpdate.php create mode 100644 src/Events/Discord/VoiceStateUpdate.php create mode 100644 src/Events/Discord/WebhooksUpdate.php diff --git a/src/Events/Discord/ApplicationCommandPermissionsUpdate.php b/src/Events/Discord/ApplicationCommandPermissionsUpdate.php new file mode 100644 index 0000000..7328d65 --- /dev/null +++ b/src/Events/Discord/ApplicationCommandPermissionsUpdate.php @@ -0,0 +1,13 @@ +discord(); + $dispatcher = $this->app->make('events'); + + $this->registerDiscordClientEvents($discord, $dispatcher); + $this->registerDiscordApplicationCommandEvents($discord, $dispatcher); + $this->registerDiscordAutoModerationEvents($discord, $dispatcher); + $this->registerDiscordChannelEvents($discord, $dispatcher); + $this->registerDiscordGuildEvents($discord, $dispatcher); + $this->registerDiscordInviteEvents($discord, $dispatcher); + $this->registerDiscordInteractionEvents($discord, $dispatcher); + $this->registerDiscordMessageEvents($discord, $dispatcher); + $this->registerDiscordPresenceEvents($discord, $dispatcher); + $this->registerDiscordStageInstanceEvents($discord, $dispatcher); + $this->registerDiscordVoiceEvents($discord, $dispatcher); + $this->registerDiscordWebhookEvents($discord, $dispatcher); + return $this; } @@ -752,7 +768,7 @@ protected function bootServices(): self */ protected function handleInteractions(): self { - $this->discord()->on(DiscordEvent::INTERACTION_CREATE, function (Interaction $interaction) { + $this->discord()->on(DiscordEvents::INTERACTION_CREATE, function (Interaction $interaction) { $id = $interaction->data->custom_id; $handlers = collect($this->getRegisteredInteractions()) @@ -1331,4 +1347,115 @@ public function message($content = '') return Message::make($this) ->content($content); } + + private function registerDiscordClientEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on('init', fn() => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientReady($this->app->make(\Laracord\Laracord::class)))); + $discord->on('reconnected', fn() => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientReconnected($this->app->make(\Laracord\Laracord::class)))); + $discord->on('trace', fn($servers) => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientTrace($this->app->make(\Laracord\Laracord::class), $servers))); + } + + private function registerDiscordApplicationCommandEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::APPLICATION_COMMAND_PERMISSIONS_UPDATE, fn(\Discord\Parts\Guild\CommandPermissions $commandPermission, \Discord\Discord $discord, ?\Discord\Parts\Guild\CommandPermissions $oldCommandPermission) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ApplicationCommandPermissionsUpdate::class, compact('commandPermission', 'oldCommandPermission')))); + } + + private function registerDiscordAutoModerationEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::AUTO_MODERATION_RULE_CREATE, fn(\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleCreate::class, compact('rule')))); + $discord->on(DiscordEvents::AUTO_MODERATION_RULE_UPDATE, fn(\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord, ?\Discord\Parts\Guild\AutoModeration\Rule $oldRule) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleUpdate::class, compact('rule', 'oldRule')))); + $discord->on(DiscordEvents::AUTO_MODERATION_RULE_DELETE, fn(\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleDelete::class, compact('rule')))); + $discord->on(DiscordEvents::AUTO_MODERATION_ACTION_EXECUTION, fn(\Discord\Parts\WebSockets\AutoModerationActionExecution $actionExecution) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationActionExecution::class, compact('actionExecution')))); + } + + private function registerDiscordChannelEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::CHANNEL_CREATE, fn(\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelCreate::class, compact('channel')))); + $discord->on(DiscordEvents::CHANNEL_DELETE, fn(\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelDelete::class, compact('channel')))); + $discord->on(DiscordEvents::CHANNEL_UPDATE, fn(\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord, ?\Discord\Parts\Channel\Channel $oldChannel) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelUpdate::class, compact('channel', 'oldChannel')))); + $discord->on(DiscordEvents::CHANNEL_PINS_UPDATE, fn(array $pins) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelPinsUpdate::class, compact('pins')))); + $discord->on(DiscordEvents::THREAD_CREATE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadCreate::class, compact('thread')))); + $discord->on(DiscordEvents::THREAD_UPDATE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord, ?\Discord\Parts\Thread\Thread $oldThread) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadUpdate::class, compact('thread', 'oldThread')))); + $discord->on(DiscordEvents::THREAD_DELETE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadDelete::class, compact('thread')))); + $discord->on(DiscordEvents::THREAD_LIST_SYNC, fn(\Discord\Helpers\Collection $threadListSync) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadListSync::class, compact('threadListSync')))); + $discord->on(DiscordEvents::THREAD_MEMBER_UPDATE, fn(\Discord\Parts\Thread\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadMemberUpdate::class, compact('member')))); + $discord->on(DiscordEvents::THREAD_MEMBERS_UPDATE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadMembersUpdate::class, compact('thread')))); + } + + private function registerDiscordGuildEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::GUILD_CREATE, fn(\stdClass|\Discord\Parts\Guild\Guild $guild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildCreate::class, compact('guild')))); + $discord->on(DiscordEvents::GUILD_UPDATE, fn(\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, ?\Discord\Parts\Guild\Guild $oldGuild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildUpdate::class, compact('guild', 'oldGuild')))); + $discord->on(DiscordEvents::GUILD_DELETE, fn(\stdClass|\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, bool $unavailable) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildDelete::class, compact('guild', 'unavailable')))); + $discord->on(DiscordEvents::GUILD_AUDIT_LOG_ENTRY_CREATE, fn(\Discord\Parts\Guild\AuditLog\Entry $entry) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildAuditLogEntryCreate::class, compact('entry')))); + $discord->on(DiscordEvents::GUILD_BAN_ADD, fn(\Discord\Parts\Guild\Ban $ban) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildBanAdd::class, compact('ban')))); + $discord->on(DiscordEvents::GUILD_BAN_REMOVE, fn(\Discord\Parts\Guild\Ban $ban) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildBanRemove::class, compact('ban')))); + $discord->on(DiscordEvents::GUILD_EMOJIS_UPDATE, fn(\Discord\Helpers\Collection $emojis, \Discord\Discord $discord, \Discord\Helpers\Collection $oldEmojis) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildEmojisUpdate::class, compact('emojis', 'oldEmojis')))); + $discord->on(DiscordEvents::GUILD_STICKERS_UPDATE, fn(\Discord\Helpers\Collection $stickers, \Discord\Discord $discord, \Discord\Helpers\Collection $oldStickers) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildStickersUpdate::class, compact('stickers', 'oldStickers')))); + $discord->on(DiscordEvents::GUILD_MEMBER_ADD, fn(\Discord\Parts\User\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberAdd::class, compact('member')))); + $discord->on(DiscordEvents::GUILD_MEMBER_REMOVE, fn(\Discord\Parts\User\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberRemove::class, compact('member')))); + $discord->on(DiscordEvents::GUILD_MEMBER_UPDATE, fn(\Discord\Parts\User\Member $member, \Discord\Discord $discord, ?\Discord\Parts\User\Member $oldMember) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberUpdate::class, compact('member', 'oldMember')))); + $discord->on(DiscordEvents::GUILD_ROLE_CREATE, fn(\Discord\Parts\Guild\Role $role) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleCreate::class, compact('role')))); + $discord->on(DiscordEvents::GUILD_ROLE_UPDATE, fn(\Discord\Parts\Guild\Role $role, \Discord\Discord $discord, ?\Discord\Parts\Guild\Role $oldRole) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleUpdate::class, compact('role', 'oldRole')))); + $discord->on(DiscordEvents::GUILD_ROLE_DELETE, fn(object $role) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleDelete::class, compact('role')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_CREATE, fn(\Discord\Parts\Guild\ScheduledEvent $event) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventCreate::class, compact('event')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_UPDATE, fn(\Discord\Parts\Guild\ScheduledEvent $event, \Discord\Discord $discord, ?\Discord\Parts\Guild\ScheduledEvent $oldEvent) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUpdate::class, compact('event', 'oldEvent')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_DELETE, fn(\Discord\Parts\Guild\ScheduledEvent $event) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventDelete::class, compact('event')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_USER_ADD, fn(object $user) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUserAdd::class, compact('user')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_USER_REMOVE, fn(object $user) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUserRemove::class, compact('user')))); + $discord->on(DiscordEvents::GUILD_INTEGRATIONS_UPDATE, fn(object $guild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildIntegrationsUpdate::class, compact('guild')))); + $discord->on(DiscordEvents::INTEGRATION_CREATE, fn(\Discord\Parts\Guild\Integration $integration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationCreate::class, compact('integration')))); + $discord->on(DiscordEvents::INTEGRATION_UPDATE, fn(\Discord\Parts\Guild\Integration $integration, \Discord\Discord $discord, ?\Discord\Parts\Guild\Integration $oldIntegration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationUpdate::class, compact('integration', 'oldIntegration')))); + $discord->on(DiscordEvents::INTEGRATION_DELETE, fn(\stdClass|\Discord\Parts\Guild\Integration $integration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationDelete::class, compact('integration')))); + } + + private function registerDiscordInviteEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::INVITE_CREATE, fn(\Discord\Parts\Channel\Invite $invite) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InviteCreate::class, compact('invite')))); + $discord->on(DiscordEvents::INVITE_DELETE, fn(\stdClass|\Discord\Parts\Channel\Invite $invite) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InviteDelete::class, compact('invite')))); + } + + private function registerDiscordInteractionEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::INTERACTION_CREATE, fn(\Discord\Parts\Interactions\Interaction $interaction) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InteractionCreate::class, compact('interaction')))); + } + + private function registerDiscordMessageEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::MESSAGE_CREATE, fn(\Discord\Parts\Channel\Message $message) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageCreate::class, compact('message')))); + $discord->on(DiscordEvents::MESSAGE_UPDATE, fn(\stdClass|\Discord\Parts\Channel\Message $message, \Discord\Discord $discord, ?\Discord\Parts\Channel\Message $oldMessage) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageUpdate::class, compact('message', 'oldMessage')))); + $discord->on(DiscordEvents::MESSAGE_DELETE, fn(\stdClass|\Discord\Parts\Channel\Message $message) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageDelete::class, compact('message')))); + $discord->on(DiscordEvents::MESSAGE_DELETE_BULK, fn(\Discord\Helpers\Collection $messages) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageDeleteBulk::class, compact('messages')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_ADD, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionAdd::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemove::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE_ALL, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemoveAll::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE_EMOJI, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemoveEmoji::class, compact('reaction')))); + } + + private function registerDiscordPresenceEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + // $discord->on(DiscordEvents::PRESENCE_UPDATE, fn(\Discord\WebSockets\Events\PresenceUpdate $presence) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\PresenceUpdate::class, compact('presence')))); + // $discord->on(DiscordEvents::USER_SETTINGS_UPDATE, fn(object $settings) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\UserSettingsUpdate::class, compact('settings')))); + + $discord->on(DiscordEvents::TYPING_START, fn(\Discord\Parts\WebSockets\TypingStart $typing) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\TypingStart::class, compact('typing')))); + $discord->on(DiscordEvents::USER_UPDATE, fn(\Discord\Parts\User\User $user, \Discord\Discord $discord, ?\Discord\Parts\User\User $oldUser) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\UserUpdate::class, compact('user', 'oldUser')))); + } + + private function registerDiscordStageInstanceEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::STAGE_INSTANCE_CREATE, fn(\Discord\Parts\Channel\StageInstance $stageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceCreate::class, compact('stageInstance')))); + $discord->on(DiscordEvents::STAGE_INSTANCE_UPDATE, fn(\Discord\Parts\Channel\StageInstance $stageInstance, \Discord\Discord $discord, ?\Discord\Parts\Channel\StageInstance $oldStageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceUpdate::class, compact('stageInstance', 'oldStageInstance')))); + $discord->on(DiscordEvents::STAGE_INSTANCE_DELETE, fn(\Discord\Parts\Channel\StageInstance $stageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceDelete::class, compact('stageInstance')))); + } + + private function registerDiscordVoiceEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::VOICE_STATE_UPDATE, fn(\Discord\Parts\WebSockets\VoiceStateUpdate $voiceState) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\VoiceStateUpdate::class, compact('voiceState')))); + $discord->on(DiscordEvents::VOICE_SERVER_UPDATE, fn(\Discord\Parts\WebSockets\VoiceServerUpdate $voiceServer) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\VoiceServerUpdate::class, compact('voiceServer')))); + } + + private function registerDiscordWebhookEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) + { + $discord->on(DiscordEvents::WEBHOOKS_UPDATE, fn(\stdClass|\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, \stdClass|\Discord\Parts\Channel\Channel $channel) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\WebhooksUpdate::class, compact('guild', 'channel')))); + } } From 313897f0dedf1692484e77ed1624c2e48740d42c Mon Sep 17 00:00:00 2001 From: QWp6t Date: Sat, 5 Oct 2024 13:46:48 -0700 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=9A=A8=20code=20styles?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ApplicationCommandPermissionsUpdate.php | 3 +- .../Discord/AutoModerationActionExecution.php | 3 +- .../Discord/AutoModerationRuleCreate.php | 3 +- .../Discord/AutoModerationRuleDelete.php | 3 +- .../Discord/AutoModerationRuleUpdate.php | 3 +- src/Events/Discord/ChannelCreate.php | 3 +- src/Events/Discord/ChannelDelete.php | 3 +- src/Events/Discord/ChannelPinsUpdate.php | 3 +- src/Events/Discord/ChannelUpdate.php | 3 +- src/Events/Discord/ClientReady.php | 3 +- src/Events/Discord/ClientReconnected.php | 3 +- src/Events/Discord/ClientTrace.php | 3 +- .../Discord/GuildAuditLogEntryCreate.php | 3 +- src/Events/Discord/GuildBanAdd.php | 3 +- src/Events/Discord/GuildBanRemove.php | 3 +- src/Events/Discord/GuildCreate.php | 3 +- src/Events/Discord/GuildDelete.php | 3 +- src/Events/Discord/GuildEmojisUpdate.php | 3 +- .../Discord/GuildIntegrationsUpdate.php | 3 +- src/Events/Discord/GuildMemberAdd.php | 3 +- src/Events/Discord/GuildMemberRemove.php | 3 +- src/Events/Discord/GuildMemberUpdate.php | 3 +- src/Events/Discord/GuildRoleCreate.php | 3 +- src/Events/Discord/GuildRoleDelete.php | 3 +- src/Events/Discord/GuildRoleUpdate.php | 3 +- .../Discord/GuildScheduledEventCreate.php | 3 +- .../Discord/GuildScheduledEventDelete.php | 3 +- .../Discord/GuildScheduledEventUpdate.php | 3 +- .../Discord/GuildScheduledEventUserAdd.php | 3 +- .../Discord/GuildScheduledEventUserRemove.php | 3 +- src/Events/Discord/GuildStickersUpdate.php | 3 +- src/Events/Discord/GuildUpdate.php | 3 +- src/Events/Discord/IntegrationCreate.php | 3 +- src/Events/Discord/IntegrationDelete.php | 3 +- src/Events/Discord/IntegrationUpdate.php | 3 +- src/Events/Discord/InteractionCreate.php | 3 +- src/Events/Discord/InviteCreate.php | 3 +- src/Events/Discord/InviteDelete.php | 3 +- src/Events/Discord/MessageCreate.php | 3 +- src/Events/Discord/MessageDelete.php | 3 +- src/Events/Discord/MessageDeleteBulk.php | 3 +- src/Events/Discord/MessageReactionAdd.php | 3 +- src/Events/Discord/MessageReactionRemove.php | 3 +- .../Discord/MessageReactionRemoveAll.php | 3 +- .../Discord/MessageReactionRemoveEmoji.php | 3 +- src/Events/Discord/MessageUpdate.php | 3 +- src/Events/Discord/PresenceUpdate.php | 3 +- src/Events/Discord/StageInstanceCreate.php | 3 +- src/Events/Discord/StageInstanceDelete.php | 3 +- src/Events/Discord/StageInstanceUpdate.php | 3 +- src/Events/Discord/ThreadCreate.php | 3 +- src/Events/Discord/ThreadDelete.php | 3 +- src/Events/Discord/ThreadListSync.php | 3 +- src/Events/Discord/ThreadMemberUpdate.php | 3 +- src/Events/Discord/ThreadMembersUpdate.php | 3 +- src/Events/Discord/ThreadUpdate.php | 3 +- src/Events/Discord/TypingStart.php | 3 +- src/Events/Discord/UserUpdate.php | 3 +- src/Events/Discord/VoiceServerUpdate.php | 3 +- src/Events/Discord/VoiceStateUpdate.php | 3 +- src/Events/Discord/WebhooksUpdate.php | 3 +- src/Laracord.php | 120 +++++++++--------- 62 files changed, 121 insertions(+), 182 deletions(-) diff --git a/src/Events/Discord/ApplicationCommandPermissionsUpdate.php b/src/Events/Discord/ApplicationCommandPermissionsUpdate.php index 7328d65..1d6df38 100644 --- a/src/Events/Discord/ApplicationCommandPermissionsUpdate.php +++ b/src/Events/Discord/ApplicationCommandPermissionsUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\CommandPermissions $commandPermission, public readonly ?\Discord\Parts\Guild\CommandPermissions $oldCommandPermission, - ) { - } + ) {} } diff --git a/src/Events/Discord/AutoModerationActionExecution.php b/src/Events/Discord/AutoModerationActionExecution.php index b30948f..a31a47b 100644 --- a/src/Events/Discord/AutoModerationActionExecution.php +++ b/src/Events/Discord/AutoModerationActionExecution.php @@ -7,6 +7,5 @@ class AutoModerationActionExecution public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\AutoModerationActionExecution $actionExecution, - ) { - } + ) {} } diff --git a/src/Events/Discord/AutoModerationRuleCreate.php b/src/Events/Discord/AutoModerationRuleCreate.php index cc0a4e3..60fd8fe 100644 --- a/src/Events/Discord/AutoModerationRuleCreate.php +++ b/src/Events/Discord/AutoModerationRuleCreate.php @@ -7,6 +7,5 @@ class AutoModerationRuleCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\AutoModeration\Rule $rule, - ) { - } + ) {} } diff --git a/src/Events/Discord/AutoModerationRuleDelete.php b/src/Events/Discord/AutoModerationRuleDelete.php index 7fcb796..3744d34 100644 --- a/src/Events/Discord/AutoModerationRuleDelete.php +++ b/src/Events/Discord/AutoModerationRuleDelete.php @@ -7,6 +7,5 @@ class AutoModerationRuleDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\AutoModeration\Rule $rule, - ) { - } + ) {} } diff --git a/src/Events/Discord/AutoModerationRuleUpdate.php b/src/Events/Discord/AutoModerationRuleUpdate.php index 562d404..0e165a9 100644 --- a/src/Events/Discord/AutoModerationRuleUpdate.php +++ b/src/Events/Discord/AutoModerationRuleUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\AutoModeration\Rule $rule, public readonly ?\Discord\Parts\Guild\AutoModeration\Rule $oldRule, - ) { - } + ) {} } diff --git a/src/Events/Discord/ChannelCreate.php b/src/Events/Discord/ChannelCreate.php index 111f907..f2968c7 100644 --- a/src/Events/Discord/ChannelCreate.php +++ b/src/Events/Discord/ChannelCreate.php @@ -7,6 +7,5 @@ class ChannelCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\Channel $channel, - ) { - } + ) {} } diff --git a/src/Events/Discord/ChannelDelete.php b/src/Events/Discord/ChannelDelete.php index ae126c3..fba4805 100644 --- a/src/Events/Discord/ChannelDelete.php +++ b/src/Events/Discord/ChannelDelete.php @@ -7,6 +7,5 @@ class ChannelDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\Channel $channel, - ) { - } + ) {} } diff --git a/src/Events/Discord/ChannelPinsUpdate.php b/src/Events/Discord/ChannelPinsUpdate.php index 1e0e320..f39b9e3 100644 --- a/src/Events/Discord/ChannelPinsUpdate.php +++ b/src/Events/Discord/ChannelPinsUpdate.php @@ -7,6 +7,5 @@ class ChannelPinsUpdate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly array $pins, - ) { - } + ) {} } diff --git a/src/Events/Discord/ChannelUpdate.php b/src/Events/Discord/ChannelUpdate.php index c015af7..7fd2907 100644 --- a/src/Events/Discord/ChannelUpdate.php +++ b/src/Events/Discord/ChannelUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\Channel $channel, public readonly ?\Discord\Parts\Channel\Channel $oldChannel, - ) { - } + ) {} } diff --git a/src/Events/Discord/ClientReady.php b/src/Events/Discord/ClientReady.php index 20e634b..ea6645a 100644 --- a/src/Events/Discord/ClientReady.php +++ b/src/Events/Discord/ClientReady.php @@ -6,6 +6,5 @@ class ClientReady { public function __construct( public readonly \Laracord\Laracord $laracord, - ) { - } + ) {} } diff --git a/src/Events/Discord/ClientReconnected.php b/src/Events/Discord/ClientReconnected.php index 3770e21..0dfc5d6 100644 --- a/src/Events/Discord/ClientReconnected.php +++ b/src/Events/Discord/ClientReconnected.php @@ -6,6 +6,5 @@ class ClientReconnected { public function __construct( public readonly \Laracord\Laracord $laracord, - ) { - } + ) {} } diff --git a/src/Events/Discord/ClientTrace.php b/src/Events/Discord/ClientTrace.php index 5b799c9..1cb9f40 100644 --- a/src/Events/Discord/ClientTrace.php +++ b/src/Events/Discord/ClientTrace.php @@ -7,6 +7,5 @@ class ClientTrace public function __construct( public readonly \Laracord\Laracord $laracord, public readonly mixed $servers, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildAuditLogEntryCreate.php b/src/Events/Discord/GuildAuditLogEntryCreate.php index 6c3300b..3f80a6d 100644 --- a/src/Events/Discord/GuildAuditLogEntryCreate.php +++ b/src/Events/Discord/GuildAuditLogEntryCreate.php @@ -7,6 +7,5 @@ class GuildAuditLogEntryCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\AuditLog\Entry $entry, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildBanAdd.php b/src/Events/Discord/GuildBanAdd.php index fb1ced6..a48fa14 100644 --- a/src/Events/Discord/GuildBanAdd.php +++ b/src/Events/Discord/GuildBanAdd.php @@ -7,6 +7,5 @@ class GuildBanAdd public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Ban $ban, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildBanRemove.php b/src/Events/Discord/GuildBanRemove.php index bcef408..5a3f19f 100644 --- a/src/Events/Discord/GuildBanRemove.php +++ b/src/Events/Discord/GuildBanRemove.php @@ -7,6 +7,5 @@ class GuildBanRemove public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Ban $ban, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildCreate.php b/src/Events/Discord/GuildCreate.php index 441000c..8ec5009 100644 --- a/src/Events/Discord/GuildCreate.php +++ b/src/Events/Discord/GuildCreate.php @@ -7,6 +7,5 @@ class GuildCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $guild, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildDelete.php b/src/Events/Discord/GuildDelete.php index 82bb71f..0a1c7e6 100644 --- a/src/Events/Discord/GuildDelete.php +++ b/src/Events/Discord/GuildDelete.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $guild, public readonly bool $unavailable, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildEmojisUpdate.php b/src/Events/Discord/GuildEmojisUpdate.php index ed1241b..7519433 100644 --- a/src/Events/Discord/GuildEmojisUpdate.php +++ b/src/Events/Discord/GuildEmojisUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Helpers\Collection $emojis, public readonly \Discord\Helpers\Collection $oldEmojis, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildIntegrationsUpdate.php b/src/Events/Discord/GuildIntegrationsUpdate.php index 90bdaab..0646deb 100644 --- a/src/Events/Discord/GuildIntegrationsUpdate.php +++ b/src/Events/Discord/GuildIntegrationsUpdate.php @@ -7,6 +7,5 @@ class GuildIntegrationsUpdate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $guild, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildMemberAdd.php b/src/Events/Discord/GuildMemberAdd.php index 810fe1c..5739b28 100644 --- a/src/Events/Discord/GuildMemberAdd.php +++ b/src/Events/Discord/GuildMemberAdd.php @@ -7,6 +7,5 @@ class GuildMemberAdd public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\User\Member $member, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildMemberRemove.php b/src/Events/Discord/GuildMemberRemove.php index aeb856e..2622dc5 100644 --- a/src/Events/Discord/GuildMemberRemove.php +++ b/src/Events/Discord/GuildMemberRemove.php @@ -7,6 +7,5 @@ class GuildMemberRemove public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\User\Member $member, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildMemberUpdate.php b/src/Events/Discord/GuildMemberUpdate.php index f299112..aec2d79 100644 --- a/src/Events/Discord/GuildMemberUpdate.php +++ b/src/Events/Discord/GuildMemberUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\User\Member $member, public readonly ?\Discord\Parts\User\Member $oldMember, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildRoleCreate.php b/src/Events/Discord/GuildRoleCreate.php index ac80e9d..a747c00 100644 --- a/src/Events/Discord/GuildRoleCreate.php +++ b/src/Events/Discord/GuildRoleCreate.php @@ -7,6 +7,5 @@ class GuildRoleCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Role $role, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildRoleDelete.php b/src/Events/Discord/GuildRoleDelete.php index 7b5712a..b223dd7 100644 --- a/src/Events/Discord/GuildRoleDelete.php +++ b/src/Events/Discord/GuildRoleDelete.php @@ -7,6 +7,5 @@ class GuildRoleDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $role, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildRoleUpdate.php b/src/Events/Discord/GuildRoleUpdate.php index 5774cab..67540af 100644 --- a/src/Events/Discord/GuildRoleUpdate.php +++ b/src/Events/Discord/GuildRoleUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Role $role, public readonly ?\Discord\Parts\Guild\Role $oldRole, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildScheduledEventCreate.php b/src/Events/Discord/GuildScheduledEventCreate.php index a6642eb..cc6e64b 100644 --- a/src/Events/Discord/GuildScheduledEventCreate.php +++ b/src/Events/Discord/GuildScheduledEventCreate.php @@ -7,6 +7,5 @@ class GuildScheduledEventCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\ScheduledEvent $scheduledEvent, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildScheduledEventDelete.php b/src/Events/Discord/GuildScheduledEventDelete.php index 72d16d0..1c32e12 100644 --- a/src/Events/Discord/GuildScheduledEventDelete.php +++ b/src/Events/Discord/GuildScheduledEventDelete.php @@ -7,6 +7,5 @@ class GuildScheduledEventDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\ScheduledEvent $scheduledEvent, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildScheduledEventUpdate.php b/src/Events/Discord/GuildScheduledEventUpdate.php index 4ee0e50..186359e 100644 --- a/src/Events/Discord/GuildScheduledEventUpdate.php +++ b/src/Events/Discord/GuildScheduledEventUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\ScheduledEvent $scheduledEvent, public readonly ?\Discord\Parts\Guild\ScheduledEvent $oldScheduledEvent, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildScheduledEventUserAdd.php b/src/Events/Discord/GuildScheduledEventUserAdd.php index a46f977..6cd8f7b 100644 --- a/src/Events/Discord/GuildScheduledEventUserAdd.php +++ b/src/Events/Discord/GuildScheduledEventUserAdd.php @@ -7,6 +7,5 @@ class GuildScheduledEventUserAdd public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $data, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildScheduledEventUserRemove.php b/src/Events/Discord/GuildScheduledEventUserRemove.php index 0afe168..22d3196 100644 --- a/src/Events/Discord/GuildScheduledEventUserRemove.php +++ b/src/Events/Discord/GuildScheduledEventUserRemove.php @@ -7,6 +7,5 @@ class GuildScheduledEventUserRemove public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $data, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildStickersUpdate.php b/src/Events/Discord/GuildStickersUpdate.php index dcf8008..203b560 100644 --- a/src/Events/Discord/GuildStickersUpdate.php +++ b/src/Events/Discord/GuildStickersUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Helpers\Collection $stickers, public readonly \Discord\Helpers\Collection $oldStickers, - ) { - } + ) {} } diff --git a/src/Events/Discord/GuildUpdate.php b/src/Events/Discord/GuildUpdate.php index 3579ce9..845f1ab 100644 --- a/src/Events/Discord/GuildUpdate.php +++ b/src/Events/Discord/GuildUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Guild $guild, public readonly ?\Discord\Parts\Guild\Guild $oldGuild, - ) { - } + ) {} } diff --git a/src/Events/Discord/IntegrationCreate.php b/src/Events/Discord/IntegrationCreate.php index 320356a..1e2359c 100644 --- a/src/Events/Discord/IntegrationCreate.php +++ b/src/Events/Discord/IntegrationCreate.php @@ -7,6 +7,5 @@ class IntegrationCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Integration $integration, - ) { - } + ) {} } diff --git a/src/Events/Discord/IntegrationDelete.php b/src/Events/Discord/IntegrationDelete.php index 715a0c1..8242794 100644 --- a/src/Events/Discord/IntegrationDelete.php +++ b/src/Events/Discord/IntegrationDelete.php @@ -7,6 +7,5 @@ class IntegrationDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $integration, - ) { - } + ) {} } diff --git a/src/Events/Discord/IntegrationUpdate.php b/src/Events/Discord/IntegrationUpdate.php index 3241984..49738d6 100644 --- a/src/Events/Discord/IntegrationUpdate.php +++ b/src/Events/Discord/IntegrationUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Guild\Integration $integration, public readonly ?\Discord\Parts\Guild\Integration $oldIntegration, - ) { - } + ) {} } diff --git a/src/Events/Discord/InteractionCreate.php b/src/Events/Discord/InteractionCreate.php index 9db7350..5ca187d 100644 --- a/src/Events/Discord/InteractionCreate.php +++ b/src/Events/Discord/InteractionCreate.php @@ -7,6 +7,5 @@ class InteractionCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Interactions\Interaction $interaction, - ) { - } + ) {} } diff --git a/src/Events/Discord/InviteCreate.php b/src/Events/Discord/InviteCreate.php index 74684f1..c18cd36 100644 --- a/src/Events/Discord/InviteCreate.php +++ b/src/Events/Discord/InviteCreate.php @@ -7,6 +7,5 @@ class InviteCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\Invite $invite, - ) { - } + ) {} } diff --git a/src/Events/Discord/InviteDelete.php b/src/Events/Discord/InviteDelete.php index f38fca9..fce7544 100644 --- a/src/Events/Discord/InviteDelete.php +++ b/src/Events/Discord/InviteDelete.php @@ -7,6 +7,5 @@ class InviteDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $invite, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageCreate.php b/src/Events/Discord/MessageCreate.php index d54505b..a978716 100644 --- a/src/Events/Discord/MessageCreate.php +++ b/src/Events/Discord/MessageCreate.php @@ -7,6 +7,5 @@ class MessageCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\Message $message, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageDelete.php b/src/Events/Discord/MessageDelete.php index 76ebe9c..c1115ea 100644 --- a/src/Events/Discord/MessageDelete.php +++ b/src/Events/Discord/MessageDelete.php @@ -7,6 +7,5 @@ class MessageDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $message, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageDeleteBulk.php b/src/Events/Discord/MessageDeleteBulk.php index 3203904..0db750f 100644 --- a/src/Events/Discord/MessageDeleteBulk.php +++ b/src/Events/Discord/MessageDeleteBulk.php @@ -7,6 +7,5 @@ class MessageDeleteBulk public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Helpers\Collection $messages, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageReactionAdd.php b/src/Events/Discord/MessageReactionAdd.php index 1c085fe..9789643 100644 --- a/src/Events/Discord/MessageReactionAdd.php +++ b/src/Events/Discord/MessageReactionAdd.php @@ -7,6 +7,5 @@ class MessageReactionAdd public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\MessageReaction $reaction, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageReactionRemove.php b/src/Events/Discord/MessageReactionRemove.php index 0906fc8..73794fe 100644 --- a/src/Events/Discord/MessageReactionRemove.php +++ b/src/Events/Discord/MessageReactionRemove.php @@ -7,6 +7,5 @@ class MessageReactionRemove public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\MessageReaction $reaction, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageReactionRemoveAll.php b/src/Events/Discord/MessageReactionRemoveAll.php index 299051a..8c56972 100644 --- a/src/Events/Discord/MessageReactionRemoveAll.php +++ b/src/Events/Discord/MessageReactionRemoveAll.php @@ -7,6 +7,5 @@ class MessageReactionRemoveAll public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\MessageReaction $reaction, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageReactionRemoveEmoji.php b/src/Events/Discord/MessageReactionRemoveEmoji.php index 70dd9ec..ca975c2 100644 --- a/src/Events/Discord/MessageReactionRemoveEmoji.php +++ b/src/Events/Discord/MessageReactionRemoveEmoji.php @@ -7,6 +7,5 @@ class MessageReactionRemoveEmoji public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\MessageReaction $reaction, - ) { - } + ) {} } diff --git a/src/Events/Discord/MessageUpdate.php b/src/Events/Discord/MessageUpdate.php index 6f1359e..8da89b7 100644 --- a/src/Events/Discord/MessageUpdate.php +++ b/src/Events/Discord/MessageUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\Message $message, public readonly ?\Discord\Parts\Channel\Message $oldMessage, - ) { - } + ) {} } diff --git a/src/Events/Discord/PresenceUpdate.php b/src/Events/Discord/PresenceUpdate.php index b25be32..b7abf0e 100644 --- a/src/Events/Discord/PresenceUpdate.php +++ b/src/Events/Discord/PresenceUpdate.php @@ -7,6 +7,5 @@ class PresenceUpdate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\WebSockets\Events\PresenceUpdate $presence, - ) { - } + ) {} } diff --git a/src/Events/Discord/StageInstanceCreate.php b/src/Events/Discord/StageInstanceCreate.php index ff00aaf..aa53b9a 100644 --- a/src/Events/Discord/StageInstanceCreate.php +++ b/src/Events/Discord/StageInstanceCreate.php @@ -7,6 +7,5 @@ class StageInstanceCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\StageInstance $stageInstance, - ) { - } + ) {} } diff --git a/src/Events/Discord/StageInstanceDelete.php b/src/Events/Discord/StageInstanceDelete.php index 1df2189..fb67793 100644 --- a/src/Events/Discord/StageInstanceDelete.php +++ b/src/Events/Discord/StageInstanceDelete.php @@ -7,6 +7,5 @@ class StageInstanceDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\StageInstance $stageInstance, - ) { - } + ) {} } diff --git a/src/Events/Discord/StageInstanceUpdate.php b/src/Events/Discord/StageInstanceUpdate.php index 45d51bb..6610ea2 100644 --- a/src/Events/Discord/StageInstanceUpdate.php +++ b/src/Events/Discord/StageInstanceUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Channel\StageInstance $stageInstance, public readonly ?\Discord\Parts\Channel\StageInstance $oldStageInstance, - ) { - } + ) {} } diff --git a/src/Events/Discord/ThreadCreate.php b/src/Events/Discord/ThreadCreate.php index b65d837..c5e6d76 100644 --- a/src/Events/Discord/ThreadCreate.php +++ b/src/Events/Discord/ThreadCreate.php @@ -7,6 +7,5 @@ class ThreadCreate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Thread\Thread $thread, - ) { - } + ) {} } diff --git a/src/Events/Discord/ThreadDelete.php b/src/Events/Discord/ThreadDelete.php index 6f1827a..40d8688 100644 --- a/src/Events/Discord/ThreadDelete.php +++ b/src/Events/Discord/ThreadDelete.php @@ -7,6 +7,5 @@ class ThreadDelete public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $thread, - ) { - } + ) {} } diff --git a/src/Events/Discord/ThreadListSync.php b/src/Events/Discord/ThreadListSync.php index 87a7e8e..b3ac133 100644 --- a/src/Events/Discord/ThreadListSync.php +++ b/src/Events/Discord/ThreadListSync.php @@ -7,6 +7,5 @@ class ThreadListSync public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Helpers\Collection $threads, - ) { - } + ) {} } diff --git a/src/Events/Discord/ThreadMemberUpdate.php b/src/Events/Discord/ThreadMemberUpdate.php index 9e751dd..15b0ebe 100644 --- a/src/Events/Discord/ThreadMemberUpdate.php +++ b/src/Events/Discord/ThreadMemberUpdate.php @@ -7,6 +7,5 @@ class ThreadMemberUpdate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Thread\Member $threadMember, - ) { - } + ) {} } diff --git a/src/Events/Discord/ThreadMembersUpdate.php b/src/Events/Discord/ThreadMembersUpdate.php index 6911d49..906c00d 100644 --- a/src/Events/Discord/ThreadMembersUpdate.php +++ b/src/Events/Discord/ThreadMembersUpdate.php @@ -7,6 +7,5 @@ class ThreadMembersUpdate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Thread\Thread $thread, - ) { - } + ) {} } diff --git a/src/Events/Discord/ThreadUpdate.php b/src/Events/Discord/ThreadUpdate.php index 8533846..0b73edc 100644 --- a/src/Events/Discord/ThreadUpdate.php +++ b/src/Events/Discord/ThreadUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\Thread\Thread $thread, public readonly ?\Discord\Parts\Thread\Thread $oldThread, - ) { - } + ) {} } diff --git a/src/Events/Discord/TypingStart.php b/src/Events/Discord/TypingStart.php index 0638140..dd03483 100644 --- a/src/Events/Discord/TypingStart.php +++ b/src/Events/Discord/TypingStart.php @@ -7,6 +7,5 @@ class TypingStart public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\TypingStart $typing, - ) { - } + ) {} } diff --git a/src/Events/Discord/UserUpdate.php b/src/Events/Discord/UserUpdate.php index 124f328..0748137 100644 --- a/src/Events/Discord/UserUpdate.php +++ b/src/Events/Discord/UserUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\User\User $user, public readonly ?\Discord\Parts\User\User $oldUser, - ) { - } + ) {} } diff --git a/src/Events/Discord/VoiceServerUpdate.php b/src/Events/Discord/VoiceServerUpdate.php index a09349b..2c659c8 100644 --- a/src/Events/Discord/VoiceServerUpdate.php +++ b/src/Events/Discord/VoiceServerUpdate.php @@ -7,6 +7,5 @@ class VoiceServerUpdate public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $voice, - ) { - } + ) {} } diff --git a/src/Events/Discord/VoiceStateUpdate.php b/src/Events/Discord/VoiceStateUpdate.php index c8632e0..e84bb9c 100644 --- a/src/Events/Discord/VoiceStateUpdate.php +++ b/src/Events/Discord/VoiceStateUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly \Discord\Parts\WebSockets\VoiceStateUpdate $state, public readonly ?\Discord\Parts\WebSockets\VoiceStateUpdate $oldState, - ) { - } + ) {} } diff --git a/src/Events/Discord/WebhooksUpdate.php b/src/Events/Discord/WebhooksUpdate.php index 89093ab..cb67dfb 100644 --- a/src/Events/Discord/WebhooksUpdate.php +++ b/src/Events/Discord/WebhooksUpdate.php @@ -8,6 +8,5 @@ public function __construct( public readonly \Laracord\Laracord $laracord, public readonly object $guild, public readonly object $channel, - ) { - } + ) {} } diff --git a/src/Laracord.php b/src/Laracord.php index b715409..db2bfb2 100644 --- a/src/Laracord.php +++ b/src/Laracord.php @@ -1350,86 +1350,86 @@ public function message($content = '') private function registerDiscordClientEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on('init', fn() => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientReady($this->app->make(\Laracord\Laracord::class)))); - $discord->on('reconnected', fn() => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientReconnected($this->app->make(\Laracord\Laracord::class)))); - $discord->on('trace', fn($servers) => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientTrace($this->app->make(\Laracord\Laracord::class), $servers))); + $discord->on('init', fn () => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientReady($this->app->make(\Laracord\Laracord::class)))); + $discord->on('reconnected', fn () => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientReconnected($this->app->make(\Laracord\Laracord::class)))); + $discord->on('trace', fn ($servers) => $dispatcher->dispatch(new \Laracord\Events\Discord\ClientTrace($this->app->make(\Laracord\Laracord::class), $servers))); } private function registerDiscordApplicationCommandEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::APPLICATION_COMMAND_PERMISSIONS_UPDATE, fn(\Discord\Parts\Guild\CommandPermissions $commandPermission, \Discord\Discord $discord, ?\Discord\Parts\Guild\CommandPermissions $oldCommandPermission) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ApplicationCommandPermissionsUpdate::class, compact('commandPermission', 'oldCommandPermission')))); + $discord->on(DiscordEvents::APPLICATION_COMMAND_PERMISSIONS_UPDATE, fn (\Discord\Parts\Guild\CommandPermissions $commandPermission, \Discord\Discord $discord, ?\Discord\Parts\Guild\CommandPermissions $oldCommandPermission) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ApplicationCommandPermissionsUpdate::class, compact('commandPermission', 'oldCommandPermission')))); } private function registerDiscordAutoModerationEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::AUTO_MODERATION_RULE_CREATE, fn(\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleCreate::class, compact('rule')))); - $discord->on(DiscordEvents::AUTO_MODERATION_RULE_UPDATE, fn(\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord, ?\Discord\Parts\Guild\AutoModeration\Rule $oldRule) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleUpdate::class, compact('rule', 'oldRule')))); - $discord->on(DiscordEvents::AUTO_MODERATION_RULE_DELETE, fn(\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleDelete::class, compact('rule')))); - $discord->on(DiscordEvents::AUTO_MODERATION_ACTION_EXECUTION, fn(\Discord\Parts\WebSockets\AutoModerationActionExecution $actionExecution) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationActionExecution::class, compact('actionExecution')))); + $discord->on(DiscordEvents::AUTO_MODERATION_RULE_CREATE, fn (\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleCreate::class, compact('rule')))); + $discord->on(DiscordEvents::AUTO_MODERATION_RULE_UPDATE, fn (\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord, ?\Discord\Parts\Guild\AutoModeration\Rule $oldRule) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleUpdate::class, compact('rule', 'oldRule')))); + $discord->on(DiscordEvents::AUTO_MODERATION_RULE_DELETE, fn (\Discord\Parts\Guild\AutoModeration\Rule $rule, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationRuleDelete::class, compact('rule')))); + $discord->on(DiscordEvents::AUTO_MODERATION_ACTION_EXECUTION, fn (\Discord\Parts\WebSockets\AutoModerationActionExecution $actionExecution) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\AutoModerationActionExecution::class, compact('actionExecution')))); } private function registerDiscordChannelEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::CHANNEL_CREATE, fn(\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelCreate::class, compact('channel')))); - $discord->on(DiscordEvents::CHANNEL_DELETE, fn(\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelDelete::class, compact('channel')))); - $discord->on(DiscordEvents::CHANNEL_UPDATE, fn(\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord, ?\Discord\Parts\Channel\Channel $oldChannel) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelUpdate::class, compact('channel', 'oldChannel')))); - $discord->on(DiscordEvents::CHANNEL_PINS_UPDATE, fn(array $pins) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelPinsUpdate::class, compact('pins')))); - $discord->on(DiscordEvents::THREAD_CREATE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadCreate::class, compact('thread')))); - $discord->on(DiscordEvents::THREAD_UPDATE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord, ?\Discord\Parts\Thread\Thread $oldThread) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadUpdate::class, compact('thread', 'oldThread')))); - $discord->on(DiscordEvents::THREAD_DELETE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadDelete::class, compact('thread')))); - $discord->on(DiscordEvents::THREAD_LIST_SYNC, fn(\Discord\Helpers\Collection $threadListSync) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadListSync::class, compact('threadListSync')))); - $discord->on(DiscordEvents::THREAD_MEMBER_UPDATE, fn(\Discord\Parts\Thread\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadMemberUpdate::class, compact('member')))); - $discord->on(DiscordEvents::THREAD_MEMBERS_UPDATE, fn(\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadMembersUpdate::class, compact('thread')))); + $discord->on(DiscordEvents::CHANNEL_CREATE, fn (\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelCreate::class, compact('channel')))); + $discord->on(DiscordEvents::CHANNEL_DELETE, fn (\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelDelete::class, compact('channel')))); + $discord->on(DiscordEvents::CHANNEL_UPDATE, fn (\Discord\Parts\Channel\Channel $channel, \Discord\Discord $discord, ?\Discord\Parts\Channel\Channel $oldChannel) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelUpdate::class, compact('channel', 'oldChannel')))); + $discord->on(DiscordEvents::CHANNEL_PINS_UPDATE, fn (array $pins) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ChannelPinsUpdate::class, compact('pins')))); + $discord->on(DiscordEvents::THREAD_CREATE, fn (\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadCreate::class, compact('thread')))); + $discord->on(DiscordEvents::THREAD_UPDATE, fn (\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord, ?\Discord\Parts\Thread\Thread $oldThread) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadUpdate::class, compact('thread', 'oldThread')))); + $discord->on(DiscordEvents::THREAD_DELETE, fn (\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadDelete::class, compact('thread')))); + $discord->on(DiscordEvents::THREAD_LIST_SYNC, fn (\Discord\Helpers\Collection $threadListSync) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadListSync::class, compact('threadListSync')))); + $discord->on(DiscordEvents::THREAD_MEMBER_UPDATE, fn (\Discord\Parts\Thread\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadMemberUpdate::class, compact('member')))); + $discord->on(DiscordEvents::THREAD_MEMBERS_UPDATE, fn (\Discord\Parts\Thread\Thread $thread, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\ThreadMembersUpdate::class, compact('thread')))); } private function registerDiscordGuildEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::GUILD_CREATE, fn(\stdClass|\Discord\Parts\Guild\Guild $guild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildCreate::class, compact('guild')))); - $discord->on(DiscordEvents::GUILD_UPDATE, fn(\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, ?\Discord\Parts\Guild\Guild $oldGuild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildUpdate::class, compact('guild', 'oldGuild')))); - $discord->on(DiscordEvents::GUILD_DELETE, fn(\stdClass|\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, bool $unavailable) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildDelete::class, compact('guild', 'unavailable')))); - $discord->on(DiscordEvents::GUILD_AUDIT_LOG_ENTRY_CREATE, fn(\Discord\Parts\Guild\AuditLog\Entry $entry) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildAuditLogEntryCreate::class, compact('entry')))); - $discord->on(DiscordEvents::GUILD_BAN_ADD, fn(\Discord\Parts\Guild\Ban $ban) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildBanAdd::class, compact('ban')))); - $discord->on(DiscordEvents::GUILD_BAN_REMOVE, fn(\Discord\Parts\Guild\Ban $ban) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildBanRemove::class, compact('ban')))); - $discord->on(DiscordEvents::GUILD_EMOJIS_UPDATE, fn(\Discord\Helpers\Collection $emojis, \Discord\Discord $discord, \Discord\Helpers\Collection $oldEmojis) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildEmojisUpdate::class, compact('emojis', 'oldEmojis')))); - $discord->on(DiscordEvents::GUILD_STICKERS_UPDATE, fn(\Discord\Helpers\Collection $stickers, \Discord\Discord $discord, \Discord\Helpers\Collection $oldStickers) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildStickersUpdate::class, compact('stickers', 'oldStickers')))); - $discord->on(DiscordEvents::GUILD_MEMBER_ADD, fn(\Discord\Parts\User\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberAdd::class, compact('member')))); - $discord->on(DiscordEvents::GUILD_MEMBER_REMOVE, fn(\Discord\Parts\User\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberRemove::class, compact('member')))); - $discord->on(DiscordEvents::GUILD_MEMBER_UPDATE, fn(\Discord\Parts\User\Member $member, \Discord\Discord $discord, ?\Discord\Parts\User\Member $oldMember) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberUpdate::class, compact('member', 'oldMember')))); - $discord->on(DiscordEvents::GUILD_ROLE_CREATE, fn(\Discord\Parts\Guild\Role $role) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleCreate::class, compact('role')))); - $discord->on(DiscordEvents::GUILD_ROLE_UPDATE, fn(\Discord\Parts\Guild\Role $role, \Discord\Discord $discord, ?\Discord\Parts\Guild\Role $oldRole) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleUpdate::class, compact('role', 'oldRole')))); - $discord->on(DiscordEvents::GUILD_ROLE_DELETE, fn(object $role) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleDelete::class, compact('role')))); - $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_CREATE, fn(\Discord\Parts\Guild\ScheduledEvent $event) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventCreate::class, compact('event')))); - $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_UPDATE, fn(\Discord\Parts\Guild\ScheduledEvent $event, \Discord\Discord $discord, ?\Discord\Parts\Guild\ScheduledEvent $oldEvent) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUpdate::class, compact('event', 'oldEvent')))); - $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_DELETE, fn(\Discord\Parts\Guild\ScheduledEvent $event) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventDelete::class, compact('event')))); - $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_USER_ADD, fn(object $user) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUserAdd::class, compact('user')))); - $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_USER_REMOVE, fn(object $user) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUserRemove::class, compact('user')))); - $discord->on(DiscordEvents::GUILD_INTEGRATIONS_UPDATE, fn(object $guild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildIntegrationsUpdate::class, compact('guild')))); - $discord->on(DiscordEvents::INTEGRATION_CREATE, fn(\Discord\Parts\Guild\Integration $integration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationCreate::class, compact('integration')))); - $discord->on(DiscordEvents::INTEGRATION_UPDATE, fn(\Discord\Parts\Guild\Integration $integration, \Discord\Discord $discord, ?\Discord\Parts\Guild\Integration $oldIntegration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationUpdate::class, compact('integration', 'oldIntegration')))); - $discord->on(DiscordEvents::INTEGRATION_DELETE, fn(\stdClass|\Discord\Parts\Guild\Integration $integration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationDelete::class, compact('integration')))); + $discord->on(DiscordEvents::GUILD_CREATE, fn (\stdClass|\Discord\Parts\Guild\Guild $guild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildCreate::class, compact('guild')))); + $discord->on(DiscordEvents::GUILD_UPDATE, fn (\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, ?\Discord\Parts\Guild\Guild $oldGuild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildUpdate::class, compact('guild', 'oldGuild')))); + $discord->on(DiscordEvents::GUILD_DELETE, fn (\stdClass|\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, bool $unavailable) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildDelete::class, compact('guild', 'unavailable')))); + $discord->on(DiscordEvents::GUILD_AUDIT_LOG_ENTRY_CREATE, fn (\Discord\Parts\Guild\AuditLog\Entry $entry) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildAuditLogEntryCreate::class, compact('entry')))); + $discord->on(DiscordEvents::GUILD_BAN_ADD, fn (\Discord\Parts\Guild\Ban $ban) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildBanAdd::class, compact('ban')))); + $discord->on(DiscordEvents::GUILD_BAN_REMOVE, fn (\Discord\Parts\Guild\Ban $ban) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildBanRemove::class, compact('ban')))); + $discord->on(DiscordEvents::GUILD_EMOJIS_UPDATE, fn (\Discord\Helpers\Collection $emojis, \Discord\Discord $discord, \Discord\Helpers\Collection $oldEmojis) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildEmojisUpdate::class, compact('emojis', 'oldEmojis')))); + $discord->on(DiscordEvents::GUILD_STICKERS_UPDATE, fn (\Discord\Helpers\Collection $stickers, \Discord\Discord $discord, \Discord\Helpers\Collection $oldStickers) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildStickersUpdate::class, compact('stickers', 'oldStickers')))); + $discord->on(DiscordEvents::GUILD_MEMBER_ADD, fn (\Discord\Parts\User\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberAdd::class, compact('member')))); + $discord->on(DiscordEvents::GUILD_MEMBER_REMOVE, fn (\Discord\Parts\User\Member $member) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberRemove::class, compact('member')))); + $discord->on(DiscordEvents::GUILD_MEMBER_UPDATE, fn (\Discord\Parts\User\Member $member, \Discord\Discord $discord, ?\Discord\Parts\User\Member $oldMember) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildMemberUpdate::class, compact('member', 'oldMember')))); + $discord->on(DiscordEvents::GUILD_ROLE_CREATE, fn (\Discord\Parts\Guild\Role $role) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleCreate::class, compact('role')))); + $discord->on(DiscordEvents::GUILD_ROLE_UPDATE, fn (\Discord\Parts\Guild\Role $role, \Discord\Discord $discord, ?\Discord\Parts\Guild\Role $oldRole) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleUpdate::class, compact('role', 'oldRole')))); + $discord->on(DiscordEvents::GUILD_ROLE_DELETE, fn (object $role) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildRoleDelete::class, compact('role')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_CREATE, fn (\Discord\Parts\Guild\ScheduledEvent $event) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventCreate::class, compact('event')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_UPDATE, fn (\Discord\Parts\Guild\ScheduledEvent $event, \Discord\Discord $discord, ?\Discord\Parts\Guild\ScheduledEvent $oldEvent) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUpdate::class, compact('event', 'oldEvent')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_DELETE, fn (\Discord\Parts\Guild\ScheduledEvent $event) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventDelete::class, compact('event')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_USER_ADD, fn (object $user) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUserAdd::class, compact('user')))); + $discord->on(DiscordEvents::GUILD_SCHEDULED_EVENT_USER_REMOVE, fn (object $user) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildScheduledEventUserRemove::class, compact('user')))); + $discord->on(DiscordEvents::GUILD_INTEGRATIONS_UPDATE, fn (object $guild) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\GuildIntegrationsUpdate::class, compact('guild')))); + $discord->on(DiscordEvents::INTEGRATION_CREATE, fn (\Discord\Parts\Guild\Integration $integration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationCreate::class, compact('integration')))); + $discord->on(DiscordEvents::INTEGRATION_UPDATE, fn (\Discord\Parts\Guild\Integration $integration, \Discord\Discord $discord, ?\Discord\Parts\Guild\Integration $oldIntegration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationUpdate::class, compact('integration', 'oldIntegration')))); + $discord->on(DiscordEvents::INTEGRATION_DELETE, fn (\stdClass|\Discord\Parts\Guild\Integration $integration) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\IntegrationDelete::class, compact('integration')))); } private function registerDiscordInviteEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::INVITE_CREATE, fn(\Discord\Parts\Channel\Invite $invite) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InviteCreate::class, compact('invite')))); - $discord->on(DiscordEvents::INVITE_DELETE, fn(\stdClass|\Discord\Parts\Channel\Invite $invite) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InviteDelete::class, compact('invite')))); + $discord->on(DiscordEvents::INVITE_CREATE, fn (\Discord\Parts\Channel\Invite $invite) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InviteCreate::class, compact('invite')))); + $discord->on(DiscordEvents::INVITE_DELETE, fn (\stdClass|\Discord\Parts\Channel\Invite $invite) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InviteDelete::class, compact('invite')))); } private function registerDiscordInteractionEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::INTERACTION_CREATE, fn(\Discord\Parts\Interactions\Interaction $interaction) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InteractionCreate::class, compact('interaction')))); + $discord->on(DiscordEvents::INTERACTION_CREATE, fn (\Discord\Parts\Interactions\Interaction $interaction) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\InteractionCreate::class, compact('interaction')))); } private function registerDiscordMessageEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::MESSAGE_CREATE, fn(\Discord\Parts\Channel\Message $message) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageCreate::class, compact('message')))); - $discord->on(DiscordEvents::MESSAGE_UPDATE, fn(\stdClass|\Discord\Parts\Channel\Message $message, \Discord\Discord $discord, ?\Discord\Parts\Channel\Message $oldMessage) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageUpdate::class, compact('message', 'oldMessage')))); - $discord->on(DiscordEvents::MESSAGE_DELETE, fn(\stdClass|\Discord\Parts\Channel\Message $message) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageDelete::class, compact('message')))); - $discord->on(DiscordEvents::MESSAGE_DELETE_BULK, fn(\Discord\Helpers\Collection $messages) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageDeleteBulk::class, compact('messages')))); - $discord->on(DiscordEvents::MESSAGE_REACTION_ADD, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionAdd::class, compact('reaction')))); - $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemove::class, compact('reaction')))); - $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE_ALL, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemoveAll::class, compact('reaction')))); - $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE_EMOJI, fn(\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemoveEmoji::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_CREATE, fn (\Discord\Parts\Channel\Message $message) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageCreate::class, compact('message')))); + $discord->on(DiscordEvents::MESSAGE_UPDATE, fn (\stdClass|\Discord\Parts\Channel\Message $message, \Discord\Discord $discord, ?\Discord\Parts\Channel\Message $oldMessage) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageUpdate::class, compact('message', 'oldMessage')))); + $discord->on(DiscordEvents::MESSAGE_DELETE, fn (\stdClass|\Discord\Parts\Channel\Message $message) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageDelete::class, compact('message')))); + $discord->on(DiscordEvents::MESSAGE_DELETE_BULK, fn (\Discord\Helpers\Collection $messages) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageDeleteBulk::class, compact('messages')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_ADD, fn (\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionAdd::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE, fn (\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemove::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE_ALL, fn (\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemoveAll::class, compact('reaction')))); + $discord->on(DiscordEvents::MESSAGE_REACTION_REMOVE_EMOJI, fn (\Discord\Parts\WebSockets\MessageReaction $reaction, \Discord\Discord $discord) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\MessageReactionRemoveEmoji::class, compact('reaction')))); } private function registerDiscordPresenceEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) @@ -1437,25 +1437,25 @@ private function registerDiscordPresenceEvents(\Discord\DiscordCommandClient $di // $discord->on(DiscordEvents::PRESENCE_UPDATE, fn(\Discord\WebSockets\Events\PresenceUpdate $presence) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\PresenceUpdate::class, compact('presence')))); // $discord->on(DiscordEvents::USER_SETTINGS_UPDATE, fn(object $settings) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\UserSettingsUpdate::class, compact('settings')))); - $discord->on(DiscordEvents::TYPING_START, fn(\Discord\Parts\WebSockets\TypingStart $typing) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\TypingStart::class, compact('typing')))); - $discord->on(DiscordEvents::USER_UPDATE, fn(\Discord\Parts\User\User $user, \Discord\Discord $discord, ?\Discord\Parts\User\User $oldUser) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\UserUpdate::class, compact('user', 'oldUser')))); + $discord->on(DiscordEvents::TYPING_START, fn (\Discord\Parts\WebSockets\TypingStart $typing) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\TypingStart::class, compact('typing')))); + $discord->on(DiscordEvents::USER_UPDATE, fn (\Discord\Parts\User\User $user, \Discord\Discord $discord, ?\Discord\Parts\User\User $oldUser) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\UserUpdate::class, compact('user', 'oldUser')))); } private function registerDiscordStageInstanceEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::STAGE_INSTANCE_CREATE, fn(\Discord\Parts\Channel\StageInstance $stageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceCreate::class, compact('stageInstance')))); - $discord->on(DiscordEvents::STAGE_INSTANCE_UPDATE, fn(\Discord\Parts\Channel\StageInstance $stageInstance, \Discord\Discord $discord, ?\Discord\Parts\Channel\StageInstance $oldStageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceUpdate::class, compact('stageInstance', 'oldStageInstance')))); - $discord->on(DiscordEvents::STAGE_INSTANCE_DELETE, fn(\Discord\Parts\Channel\StageInstance $stageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceDelete::class, compact('stageInstance')))); + $discord->on(DiscordEvents::STAGE_INSTANCE_CREATE, fn (\Discord\Parts\Channel\StageInstance $stageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceCreate::class, compact('stageInstance')))); + $discord->on(DiscordEvents::STAGE_INSTANCE_UPDATE, fn (\Discord\Parts\Channel\StageInstance $stageInstance, \Discord\Discord $discord, ?\Discord\Parts\Channel\StageInstance $oldStageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceUpdate::class, compact('stageInstance', 'oldStageInstance')))); + $discord->on(DiscordEvents::STAGE_INSTANCE_DELETE, fn (\Discord\Parts\Channel\StageInstance $stageInstance) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\StageInstanceDelete::class, compact('stageInstance')))); } private function registerDiscordVoiceEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::VOICE_STATE_UPDATE, fn(\Discord\Parts\WebSockets\VoiceStateUpdate $voiceState) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\VoiceStateUpdate::class, compact('voiceState')))); - $discord->on(DiscordEvents::VOICE_SERVER_UPDATE, fn(\Discord\Parts\WebSockets\VoiceServerUpdate $voiceServer) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\VoiceServerUpdate::class, compact('voiceServer')))); + $discord->on(DiscordEvents::VOICE_STATE_UPDATE, fn (\Discord\Parts\WebSockets\VoiceStateUpdate $voiceState) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\VoiceStateUpdate::class, compact('voiceState')))); + $discord->on(DiscordEvents::VOICE_SERVER_UPDATE, fn (\Discord\Parts\WebSockets\VoiceServerUpdate $voiceServer) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\VoiceServerUpdate::class, compact('voiceServer')))); } private function registerDiscordWebhookEvents(\Discord\DiscordCommandClient $discord, \Illuminate\Contracts\Events\Dispatcher $dispatcher) { - $discord->on(DiscordEvents::WEBHOOKS_UPDATE, fn(\stdClass|\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, \stdClass|\Discord\Parts\Channel\Channel $channel) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\WebhooksUpdate::class, compact('guild', 'channel')))); + $discord->on(DiscordEvents::WEBHOOKS_UPDATE, fn (\stdClass|\Discord\Parts\Guild\Guild $guild, \Discord\Discord $discord, \stdClass|\Discord\Parts\Channel\Channel $channel) => $dispatcher->dispatch($this->app->make(\Laracord\Events\Discord\WebhooksUpdate::class, compact('guild', 'channel')))); } }