diff options
author | Dennis Kobert <dennis@kobert.dev> | 2020-08-04 20:31:39 +0200 |
---|---|---|
committer | Dennis Kobert <dennis@kobert.dev> | 2020-08-04 20:31:39 +0200 |
commit | f14ba9816bf32c7998a97a9cb55565a9e9a9bae5 (patch) | |
tree | 653e31f08018abd4e47870679469dd81662c5b55 /src/commands/math.rs |
Diffstat (limited to 'src/commands/math.rs')
-rw-r--r-- | src/commands/math.rs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/src/commands/math.rs b/src/commands/math.rs new file mode 100644 index 0000000..ce7beed --- /dev/null +++ b/src/commands/math.rs @@ -0,0 +1,18 @@ +use serenity::prelude::*; +use serenity::model::prelude::*; +use serenity::framework::standard::{ + Args, CommandResult, + macros::command, +}; + +#[command] +pub fn multiply(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult { + let one = args.single::<f64>().unwrap(); + let two = args.single::<f64>().unwrap(); + + let product = one * two; + + let _ = msg.channel_id.say(&ctx.http, product); + + Ok(()) +} |