Added pause, play, resume, skip, and stop
This commit is contained in:
@@ -21,6 +21,10 @@ impl EventHandler for Handler {
|
||||
if let Interaction::ApplicationCommand(command) = interaction {
|
||||
match command.data.name.as_str() {
|
||||
"play" => commands::audio::play::run(&ctx, &command).await,
|
||||
"stop" => commands::audio::stop::run(&ctx, &command).await,
|
||||
"pause" => commands::audio::pause::run(&ctx, &command).await,
|
||||
"resume" => commands::audio::resume::run(&ctx, &command).await,
|
||||
"skip" => commands::audio::skip::run(&ctx, &command).await,
|
||||
_ => {
|
||||
let content: String = match command.data.name.as_str() {
|
||||
"ping" => commands::ping::run(&command.data.options),
|
||||
@@ -43,6 +47,10 @@ impl EventHandler for Handler {
|
||||
let commands = guild.id.set_application_commands(&ctx.http, |commands| {
|
||||
commands.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::ping::register(command) })
|
||||
.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::play::register(command) })
|
||||
.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::stop::register(command) })
|
||||
.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::pause::register(command) })
|
||||
.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::resume::register(command) })
|
||||
.create_application_command(|command: &mut serenity::builder::CreateApplicationCommand| { commands::audio::skip::register(command) })
|
||||
}).await;
|
||||
match commands {
|
||||
Ok(c) => info!("Registered {} commands for guild {}", c.len(), guild.id.0),
|
||||
|
||||
Reference in New Issue
Block a user