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