diff options
| -rw-r--r-- | src/bot/music.rs | 3 | ||||
| -rw-r--r-- | src/command.rs | 2 |
2 files changed, 5 insertions, 0 deletions
diff --git a/src/bot/music.rs b/src/bot/music.rs index 5f7928e..25c5d4b 100644 --- a/src/bot/music.rs +++ b/src/bot/music.rs @@ -329,6 +329,9 @@ impl MusicBot { self.add_audio(url.to_string(), invoker.name).await; } + Command::Search { query } => { + self.add_audio(format!("ytsearch:{}", query.join(" ")), invoker.name).await; + } Command::Pause => { self.player.pause()?; } diff --git a/src/command.rs b/src/command.rs index db22028..c907d51 100644 --- a/src/command.rs +++ b/src/command.rs @@ -15,6 +15,8 @@ use structopt::StructOpt; pub enum Command { /// Adds url to playlist Add { url: String }, + /// Adds the first video found on YouTube + Search { query: Vec<String> }, /// Starts audio playback Play, /// Pauses audio playback |
