X-Git-Url: https://git.localhorst.tv/?a=blobdiff_plain;f=app%2FDiscordAppCommands%2FAosrPresetCommand.php;fp=app%2FDiscordAppCommands%2FAosrPresetCommand.php;h=e4d0fbb529ddf08c0eab8756f2fef82fa0d791f2;hb=9e08a6086d2c982ec9a2b9b79e3441ac8347f695;hp=7a8907a419c87b3258ded2761bed28144de30380;hpb=7f559e51e1ce1cc61280e0e548bb59a53b86f151;p=alttp.git diff --git a/app/DiscordAppCommands/AosrPresetCommand.php b/app/DiscordAppCommands/AosrPresetCommand.php index 7a8907a..e4d0fbb 100644 --- a/app/DiscordAppCommands/AosrPresetCommand.php +++ b/app/DiscordAppCommands/AosrPresetCommand.php @@ -54,6 +54,17 @@ class AosrPresetCommand { $discord->application->commands->save($cmd); } + public static function delete(Discord $discord) { + $discord->application->commands->freshen()->then(function () use ($discord) { + $cmd = $discord->application->commands->find(function ($cmd) { + return $cmd->name == 'aosr'; + }); + if ($cmd) { + $discord->application->commands->delete($cmd); + } + }); + } + public static function presetByName($name) { if (isset(static::$presets[$name])) { return static::$presets[$name];