From e6f99a32928b6973c5f23464d9a08f603a4555b2 Mon Sep 17 00:00:00 2001 From: Jokler Date: Mon, 24 Feb 2020 22:54:35 +0100 Subject: Quote: Make subcommands case insensitive --- src/plugins/quote/mod.rs | 7 ++++--- 1 file 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 Plugin for Quote { 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), -- cgit v1.2.3-70-g09d2