|
|
@ -5,7 +5,7 @@ use serenity::model::channel::Message;
|
|
|
|
|
|
|
|
|
|
|
|
use crate::commands::common::handle_autodelete;
|
|
|
|
use crate::commands::common::handle_autodelete;
|
|
|
|
use crate::commands::music::{
|
|
|
|
use crate::commands::music::{
|
|
|
|
get_channel_for_author, get_queue_for_guild, get_songs_for_query, get_voice_manager,
|
|
|
|
get_channel_for_author, get_queue_for_guild, get_songs_for_query, get_voice_manager, is_dj,
|
|
|
|
join_channel, play_next_in_queue,
|
|
|
|
join_channel, play_next_in_queue,
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
@ -15,13 +15,15 @@ use crate::commands::music::{
|
|
|
|
#[usage("<song-url>")]
|
|
|
|
#[usage("<song-url>")]
|
|
|
|
#[min_args(1)]
|
|
|
|
#[min_args(1)]
|
|
|
|
#[aliases("pn", "play-next")]
|
|
|
|
#[aliases("pn", "play-next")]
|
|
|
|
#[allowed_roles("DJ")]
|
|
|
|
|
|
|
|
async fn play_next(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
|
|
|
|
async fn play_next(ctx: &Context, msg: &Message, args: Args) -> CommandResult {
|
|
|
|
let query = args.message();
|
|
|
|
let query = args.message();
|
|
|
|
|
|
|
|
|
|
|
|
let guild = msg.guild(&ctx.cache).await.unwrap();
|
|
|
|
let guild = msg.guild(&ctx.cache).await.unwrap();
|
|
|
|
log::debug!("Playing song as next song for guild {}", guild.id);
|
|
|
|
log::debug!("Playing song as next song for guild {}", guild.id);
|
|
|
|
|
|
|
|
if !is_dj(ctx, guild.id, &msg.author).await? {
|
|
|
|
|
|
|
|
msg.channel_id.say(ctx, "Requires DJ permissions").await?;
|
|
|
|
|
|
|
|
return Ok(());
|
|
|
|
|
|
|
|
}
|
|
|
|
let manager = get_voice_manager(ctx).await;
|
|
|
|
let manager = get_voice_manager(ctx).await;
|
|
|
|
let mut handler = manager.get(guild.id);
|
|
|
|
let mut handler = manager.get(guild.id);
|
|
|
|
|
|
|
|
|
|
|
|