Only consume max allowed commands + 1 when dealing with multiple commands

This commit is contained in:
projectmoon 2021-03-15 20:13:27 +00:00
parent 8e4eb574d2
commit d30d39ff1e
1 changed files with 1 additions and 0 deletions

View File

@ -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.