diff options
| author | Nathan Perry <avaglir@gmail.com> | 2018-02-14 15:03:40 -0500 |
|---|---|---|
| committer | Nathan Perry <avaglir@gmail.com> | 2018-02-14 15:03:40 -0500 |
| commit | 61e63991196f39631ab5ac8dae0fbda728935d8c (patch) | |
| tree | b075ae0ea41fe17cc111e11715da4cc949936e9e /src/commands.rs | |
| parent | 97aae076bd3964aa4e9c697e734e2ff71b10f3c5 (diff) | |
remove default text channel
Diffstat (limited to 'src/commands.rs')
| -rw-r--r-- | src/commands.rs | 10 |
1 files changed, 5 insertions, 5 deletions
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, }); }); |
