forked from projectmoon/tenebrous-dicebot
Only consume max allowed commands + 1 when dealing with multiple commands
This commit is contained in:
parent
8e4eb574d2
commit
d30d39ff1e
|
@ -189,6 +189,7 @@ impl DiceBot {
|
||||||
let commands: Vec<&str> = msg_body
|
let commands: Vec<&str> = msg_body
|
||||||
.lines()
|
.lines()
|
||||||
.filter(|line| line.starts_with("!"))
|
.filter(|line| line.starts_with("!"))
|
||||||
|
.take(MAX_COMMANDS_PER_MESSAGE + 1)
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
//Up to 50 commands allowed, otherwise we send back an error.
|
//Up to 50 commands allowed, otherwise we send back an error.
|
||||||
|
|
Loading…
Reference in New Issue