]> git.localhorst.tv Git - alttp.git/commitdiff
set discord bot status
authorDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 29 Apr 2022 12:50:16 +0000 (14:50 +0200)
committerDaniel Karbach <daniel.karbach@localhorst.tv>
Fri, 29 Apr 2022 12:50:16 +0000 (14:50 +0200)
app/Console/Commands/DiscordBotCommand.php

index 066f5ff51920027f5b0f72b1bb609532d5bb484e..c0a92b885867161acc1ed350574a5b32de070972 100644 (file)
@@ -10,6 +10,7 @@ use Discord\Parts\Channel\Channel;
 use Discord\Parts\Channel\Message;
 use Discord\Parts\Guild\Guild;
 use Discord\Parts\Guild\Role;
+use Discord\Parts\User\Activity;
 use Discord\WebSockets\Event;
 use Illuminate\Console\Command;
 use Monolog\Handler\StreamHandler;
@@ -45,6 +46,13 @@ class DiscordBotCommand extends Command
                        'logger' => $logger,
                        'token' => config('discord.token'),
                ]);
+               $discord->on('ready', function (Discord $discord) {
+                       $activity = new Activity($discord);
+                       $activity->type = Activity::TYPE_LISTENING;
+                       $activity->name = 'HolySmoke';
+                       $activity->url = 'https://alttp.localhorst.tv/';
+                       $discord->updatePresence($activity);
+               });
                $discord->on(Event::GUILD_CREATE, function (Guild $guild, Discord $discord) {
                        try {
                                DiscordGuild::onUpstreamCreate($guild);