diff options
| author | Jokler <jokler@protonmail.com> | 2020-02-24 22:54:35 +0100 |
|---|---|---|
| committer | Jokler <jokler@protonmail.com> | 2020-02-24 22:54:35 +0100 |
| commit | e6f99a32928b6973c5f23464d9a08f603a4555b2 (patch) | |
| tree | 64c7a5337184a3544c32294dbb45e9131cf374bd | |
| parent | d9cebeb6a7d5cce181121190ac122df29fe6d5c6 (diff) | |
| download | frippy-dev.tar.gz frippy-dev.zip | |
Quote: Make subcommands case insensitivedev
| -rw-r--r-- | src/plugins/quote/mod.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/plugins/quote/mod.rs b/src/plugins/quote/mod.rs index 7223b42..5ce4fe9 100644 --- a/src/plugins/quote/mod.rs +++ b/src/plugins/quote/mod.rs @@ -10,11 +10,12 @@ use irc::client::prelude::*; use rand::{thread_rng, Rng}; use time; -use crate::plugin::*; -use crate::FrippyClient; pub mod database; use self::database::Database; +use crate::plugin::*; +use crate::FrippyClient; + use self::error::*; use crate::error::ErrorKind as FrippyErrorKind; use crate::error::FrippyError; @@ -371,7 +372,7 @@ impl<T: Database, C: FrippyClient> Plugin for Quote<T, C> { let target = command.target.clone(); let source = command.source.clone(); - let sub_command = command.tokens.remove(0); + let sub_command = command.tokens.remove(0).to_lowercase(); let result = match sub_command.as_ref() { "add" => self.add(&mut command).map(|s| Private(s.to_owned())), "get" => self.get(&command).map(Public), |
