summaryrefslogtreecommitdiff
path: root/07_sample_bot_structure/src/commands/meta.rs
diff options
context:
space:
mode:
authorDennis Kobert <dennis@kobert.dev>2020-08-04 20:31:39 +0200
committerDennis Kobert <dennis@kobert.dev>2020-08-04 20:31:39 +0200
commitf14ba9816bf32c7998a97a9cb55565a9e9a9bae5 (patch)
tree653e31f08018abd4e47870679469dd81662c5b55 /07_sample_bot_structure/src/commands/meta.rs
Initial commitHEADmaster
Diffstat (limited to '07_sample_bot_structure/src/commands/meta.rs')
-rw-r--r--07_sample_bot_structure/src/commands/meta.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/07_sample_bot_structure/src/commands/meta.rs b/07_sample_bot_structure/src/commands/meta.rs
new file mode 100644
index 0000000..d58af10
--- /dev/null
+++ b/07_sample_bot_structure/src/commands/meta.rs
@@ -0,0 +1,13 @@
+use serenity::prelude::*;
+use serenity::model::prelude::*;
+use serenity::framework::standard::{
+ CommandResult,
+ macros::command,
+};
+
+#[command]
+fn ping(ctx: &mut Context, msg: &Message) -> CommandResult {
+ let _ = msg.channel_id.say(&ctx.http, "Pong!");
+
+ Ok(())
+}