diff options
| author | Jokler <jokler@protonmail.com> | 2020-03-06 20:27:49 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-03-06 20:27:49 +0100 |
| commit | 73b89cdebf7eb041bbf6c8322d6dc74a045437e4 (patch) | |
| tree | aceefa744f14acc41c590b07430b430a204261b9 | |
| parent | 6f9806abdbfa61583b25fd544c41a017a574686c (diff) | |
| parent | d4f743801e6e88f90352ad08b86676cc97430664 (diff) | |
| download | pokebot-73b89cdebf7eb041bbf6c8322d6dc74a045437e4.tar.gz pokebot-73b89cdebf7eb041bbf6c8322d6dc74a045437e4.zip | |
Merge pull request #43 from Mavulp/search-command
Add search command to the music bot
| -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 |
