From b48cd394658cfae3d46f39560129a2c7399dfedf Mon Sep 17 00:00:00 2001 From: Evan Maddock Date: Tue, 23 Jul 2024 14:59:48 -0400 Subject: [PATCH] commands: Add doc comments Signed-off-by: Evan Maddock --- src/discord/commands/minecraft.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/discord/commands/minecraft.rs b/src/discord/commands/minecraft.rs index 69c3a33..c604091 100644 --- a/src/discord/commands/minecraft.rs +++ b/src/discord/commands/minecraft.rs @@ -14,6 +14,7 @@ use serenity::{ use thiserror::Error; use tokio::time::sleep; +/// Prints out an embed listing the currently-supported commands. pub async fn help(ctx: Context, command: CommandInteraction) -> Result<(), Error> { let embed = CreateEmbed::new() .title("Dolphin Help") @@ -40,6 +41,11 @@ pub async fn help(ctx: Context, command: CommandInteraction) -> Result<(), Error Ok(()) } +/// Lists all players currently on the Minecraft server. +/// +/// This works by calling the Minecraft `list` command via RCON, +/// and listening for the response. The response is parsed to get +/// the online player count, as well as their names. pub async fn list(ctx: Context, command: CommandInteraction) -> Result<(), Error> { let config = ctx .data