From f14ba9816bf32c7998a97a9cb55565a9e9a9bae5 Mon Sep 17 00:00:00 2001 From: Dennis Kobert Date: Tue, 4 Aug 2020 20:31:39 +0200 Subject: Initial commit --- src/commands/math.rs | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 src/commands/math.rs (limited to 'src/commands/math.rs') 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::().unwrap(); + let two = args.single::().unwrap(); + + let product = one * two; + + let _ = msg.channel_id.say(&ctx.http, product); + + Ok(()) +} -- cgit v1.2.3-70-g09d2