summaryrefslogtreecommitdiff
path: root/07_sample_bot_structure/src/commands/meta.rs
diff options
context:
space:
mode:
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(())
+}