summaryrefslogtreecommitdiff
path: root/src/commands/math.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/commands/math.rs')
-rw-r--r--src/commands/math.rs18
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(())
+}