});
if (config('discord.enable_commands')) {
- AosrPresetCommand::listen($discord);
+ //AosrPresetCommand::listen($discord);
}
if (config('discord.create_commands')) {
- AosrPresetCommand::create($discord);
+ AosrPresetCommand::delete($discord);
}
});
$discord->on(Event::GUILD_CREATE, function (Guild $guild, Discord $discord) {
$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];