Loading src/pizza/main.rs +7 −6 Original line number Diff line number Diff line Loading @@ -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())); }); Loading @@ -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, "--"); } Loading src/spacebot/cmd.rs +9 −2 Original line number Diff line number Diff line 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; Loading Loading @@ -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)), } } } } Loading Loading
src/pizza/main.rs +7 −6 Original line number Diff line number Diff line Loading @@ -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())); }); Loading @@ -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, "--"); } Loading
src/spacebot/cmd.rs +9 −2 Original line number Diff line number Diff line 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; Loading Loading @@ -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)), } } } } Loading