Verified Commit 7eaef8ab authored by fooker's avatar fooker 👽
Browse files

Make bot less chatty

parent 3a667c00
Loading
Loading
Loading
Loading
Loading
+7 −6
Original line number Diff line number Diff line
@@ -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,
                                "--");
                }

+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;
@@ -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)),
                    }
                }
            }
        }