aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-02-24 22:54:35 +0100
committerJokler <jokler@protonmail.com>2020-02-24 22:54:35 +0100
commite6f99a32928b6973c5f23464d9a08f603a4555b2 (patch)
tree64c7a5337184a3544c32294dbb45e9131cf374bd
parentd9cebeb6a7d5cce181121190ac122df29fe6d5c6 (diff)
downloadfrippy-e6f99a32928b6973c5f23464d9a08f603a4555b2.tar.gz
frippy-e6f99a32928b6973c5f23464d9a08f603a4555b2.zip
Quote: Make subcommands case insensitivedev
-rw-r--r--src/plugins/quote/mod.rs7
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),