From d30d39ff1ec72260330f55ed7628fe07b61e5933 Mon Sep 17 00:00:00 2001 From: projectmoon Date: Mon, 15 Mar 2021 20:13:27 +0000 Subject: [PATCH] Only consume max allowed commands + 1 when dealing with multiple commands --- src/bot.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/bot.rs b/src/bot.rs index 1ab4800..89c9f77 100644 --- a/src/bot.rs +++ b/src/bot.rs @@ -189,6 +189,7 @@ impl DiceBot { let commands: Vec<&str> = msg_body .lines() .filter(|line| line.starts_with("!")) + .take(MAX_COMMANDS_PER_MESSAGE + 1) .collect(); //Up to 50 commands allowed, otherwise we send back an error.