|
|
|
@ -4,7 +4,7 @@ use serenity::framework::standard::{Args, CommandResult};
|
|
|
|
|
use serenity::model::channel::Message;
|
|
|
|
|
|
|
|
|
|
use crate::commands::common::handle_autodelete;
|
|
|
|
|
use crate::commands::music::{get_channel_for_author, join_channel};
|
|
|
|
|
use crate::commands::music::{get_channel_for_author, is_dj, join_channel};
|
|
|
|
|
use serenity::model::id::ChannelId;
|
|
|
|
|
|
|
|
|
|
#[command]
|
|
|
|
@ -15,7 +15,11 @@ use serenity::model::id::ChannelId;
|
|
|
|
|
async fn join(ctx: &Context, msg: &Message, mut args: Args) -> CommandResult {
|
|
|
|
|
let guild = msg.guild(&ctx.cache).await.unwrap();
|
|
|
|
|
let channel_id = if let Ok(arg) = args.single::<u64>() {
|
|
|
|
|
ChannelId(arg)
|
|
|
|
|
if is_dj(ctx, guild.id, &msg.author).await? {
|
|
|
|
|
ChannelId(arg)
|
|
|
|
|
} else {
|
|
|
|
|
get_channel_for_author(&msg.author.id, &guild)?
|
|
|
|
|
}
|
|
|
|
|
} else {
|
|
|
|
|
get_channel_for_author(&msg.author.id, &guild)?
|
|
|
|
|
};
|
|
|
|
|