diff --git a/src/bot/commands/rating.rs b/src/bot/commands/rating.rs index acf7a09..d936945 100644 --- a/src/bot/commands/rating.rs +++ b/src/bot/commands/rating.rs @@ -26,7 +26,7 @@ impl MixerCommand for RatingCommand { fn create(&self, command: &mut CreateApplicationCommand) { command .name(self.name()) - .description("") + .description("Set user's rating on specific role") .create_option(|option| { option .name("set") diff --git a/src/bot/mod.rs b/src/bot/mod.rs index ed3cd69..1f9af32 100644 --- a/src/bot/mod.rs +++ b/src/bot/mod.rs @@ -40,7 +40,17 @@ impl EventHandler for MixerBot { async fn ready(&self, ctx: Context, data_about_bot: Ready) { info!("{} is connected!", data_about_bot.user.name); - Command::set_global_application_commands(&ctx.http, |commands| { + let commands = Command::get_global_application_commands(&ctx) + .await + .unwrap(); + + for command in commands { + Command::delete_global_application_command(&ctx, command.id) + .await + .unwrap(); + } + + Command::set_global_application_commands(ctx, |commands| { self.command_handler.create_all(commands); commands })