Commit 7eaef8ab authored by fooker's avatar fooker 👽

Make bot less chatty

parent 3a667c00
Pipeline #352 passed with stage
in 13 minutes and 52 seconds
......@@ -175,9 +175,7 @@ impl PizzaBot {
response.reply(&format!(" {}: {}", k, v));
}
response.reply("--");
response.reply(&format!("Deadline for this order is {:02}:{:02}",
response.reply(&format!("-- Deadline for this order is {:02}:{:02}",
run.deadline.hour(),
run.deadline.minute()));
});
......@@ -203,14 +201,17 @@ impl CommandModule for PizzaBot {
let run = state.take().unwrap();
client.send(&channel,
&format!("Ok, time is over. {}, you have to place the following order:", run.owner));
&format!("Ok, time is over. {}, you have to place the order:", run.owner));
client.send(&run.owner,
&format!("It's your turn. Pleas place the following order:"));
for (k, v) in run.orders.iter() {
client.send(&channel,
client.send(&run.owner,
&format!(" {}: {}", k, v));
}
client.send(&channel,
client.send(&run.owner,
"--");
}
......
pub use clap::{App, AppSettings, Arg, ArgMatches, SubCommand, Values};
pub use clap::{App, AppSettings, Arg, ArgMatches, SubCommand, Values, ErrorKind as AppErrorKind};
use crate::bot::{Initializer, Module, Request, Response};
use crate::config::ModuleConfig;
use shellwords;
......@@ -73,7 +73,14 @@ impl<M> Module for M
});
}
Err(err) => {
response.reply(&format!("Error: {}", &err.message));
match err.kind {
AppErrorKind::HelpDisplayed => response.send(
request.source_nickname(),
&err.message
),
_ => response.reply(&format!("Error: {}", &err.message)),
}
}
}
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment