forked from projectmoon/tenebrous-dicebot
parent
0e04e67f6e
commit
e251294b5f
|
@ -124,14 +124,14 @@ impl DiceBot {
|
|||
|
||||
let mut results = Vec::with_capacity(msg_body.lines().count());
|
||||
|
||||
for command in msg_body.lines() {
|
||||
if !command.is_empty() {
|
||||
let commands = msg_body.trim().lines().filter(|line| line.starts_with("!"));
|
||||
|
||||
for command in commands {
|
||||
let ctx = Context::new(&self.db, &room_id.as_str(), &sender_username, &command);
|
||||
if let Some(cmd_result) = execute_command(&ctx).await {
|
||||
results.push(cmd_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if results.len() >= 1 {
|
||||
if results.len() == 1 {
|
||||
|
|
Loading…
Reference in New Issue