From 61e63991196f39631ab5ac8dae0fbda728935d8c Mon Sep 17 00:00:00 2001 From: Nathan Perry Date: Wed, 14 Feb 2018 15:03:40 -0500 Subject: remove default text channel --- src/commands.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/commands.rs b/src/commands.rs index 711cf25..4877193 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -30,6 +30,7 @@ impl VoiceManager { struct PlayArgs { url: String, initiator: String, + sender_channel: ChannelId, } #[derive(Clone)] @@ -69,8 +70,6 @@ impl PlayQueue { let sleep = || thread::sleep(Duration::from_millis(250)); let voice_manager = voice_manager; - let channel = ChannelId(must_env_lookup("DEFAULT_CHANNEL")); - loop { let mut queue = queue_lck.lock().unwrap(); @@ -102,8 +101,8 @@ impl PlayQueue { let src = match ytdl(&item.url) { Ok(src) => src, Err(e) => { - error!("bad link: {}; {}", &item.url, e); - let _ = send(channel, &format!("what the fuck"), false); + error!("bad link: {}; {:?}", &item.url, e); + let _ = send(item.sender_channel, &format!("what the fuck"), false); sleep(); continue; } @@ -125,7 +124,7 @@ impl PlayQueue { }, None => { error!("couldn't join channel"); - let _ = send(channel, "something happened somewhere somehow.", false); + let _ = send(item.sender_channel, "something happened somewhere somehow.", false); } } @@ -206,6 +205,7 @@ command!(play(ctx, msg, args) { play_queue.queue.push_back(PlayArgs{ initiator: msg.author.name.clone(), url, + sender_channel: msg.channel_id, }); }); -- cgit v1.3.1