aboutsummaryrefslogtreecommitdiff
path: root/src/commands/roll.rs
diff options
context:
space:
mode:
authorNathan Perry <np@nathanperry.dev>2019-11-17 22:51:59 -0500
committerNathan Perry <np@nathanperry.dev>2019-11-17 22:51:59 -0500
commit8b2ccf363ac6894c21e256844948c8327645f0db (patch)
treef6742f2d7905613b8c0404bba46e237f984a8da2 /src/commands/roll.rs
parent2a38c282dd57c2051a568549d62c80d6036e8920 (diff)
mostly fixed
Diffstat (limited to 'src/commands/roll.rs')
-rw-r--r--src/commands/roll.rs15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/commands/roll.rs b/src/commands/roll.rs
index 3df91d0..1544654 100644
--- a/src/commands/roll.rs
+++ b/src/commands/roll.rs
@@ -1,12 +1,23 @@
use std::result::Result as StdResult;
+use log::{
+ debug,
+ error,
+};
use rand::prelude::*;
use serenity::{
- framework::standard::Args,
+ framework::standard::{
+ Args,
+ CommandResult,
+ macros::command,
+ },
model::channel::Message,
prelude::*,
};
use statrs;
+use thiserror::Error;
+
+use lazy_static::lazy_static;
use crate::{
Result,
@@ -198,7 +209,7 @@ mod test {
#[command]
#[aliases("calc", "calculate")]
-pub fn roll(ctx: &mut Context, msg: &Message, args: Args) -> Result<()> {
+pub fn roll(ctx: &mut Context, msg: &Message, args: Args) -> CommandResult {
match Calc::eval(args.rest()) {
Ok(result) => {
debug!("got calc result '{}'", result);