From: Daniel Karbach Date: Wed, 9 Jul 2025 13:42:30 +0000 (+0200) Subject: event banner X-Git-Url: http://git.localhorst.tv/?a=commitdiff_plain;h=28d7f970d2fb9da4a7cb356fde5c9b50b53dce8f;p=alttp.git event banner --- diff --git a/app/DiscordBotCommands/EpisodeEventCommand.php b/app/DiscordBotCommands/EpisodeEventCommand.php index 3dc03bb..4c716b6 100644 --- a/app/DiscordBotCommands/EpisodeEventCommand.php +++ b/app/DiscordBotCommands/EpisodeEventCommand.php @@ -9,6 +9,7 @@ use Carbon\Carbon; use Discord\Discord; use Discord\Parts\Guild\Guild; use Discord\Parts\Guild\ScheduledEvent; +use Illuminate\Support\Facades\Storage; use React\Promise\PromiseInterface; class EpisodeEventCommand extends BaseCommand { @@ -66,7 +67,12 @@ class EpisodeEventCommand extends BaseCommand { $event->entity_metadata = [ 'location' => $episode->getRestreamLink(), ]; - $event->image = ''; + if ($episode->event && $episode->event->banner) { + $file = Storage::get($episode->event->banner); + $event->image = 'data:image/png;base64,'.base64_encode($file); + } else { + $event->image = ''; + } } } diff --git a/database/migrations/2025_07_09_113355_event_banner.php b/database/migrations/2025_07_09_113355_event_banner.php new file mode 100644 index 0000000..59d8b51 --- /dev/null +++ b/database/migrations/2025_07_09_113355_event_banner.php @@ -0,0 +1,26 @@ +string('banner')->default(''); + }); + } + + /** + * Reverse the migrations. + */ + public function down(): void { + Schema::table('events', function(Blueprint $table) { + $table->dropColumn('banner'); + }); + } +};