use serenity::framework::standard::{macros::command, Args, CommandResult}; use serenity::model::channel::Message; use serenity::prelude::Context; #[command] async fn clap(ctx: &mut Context, msg: &Message, mut args: Args) -> CommandResult { let resp = match args .iter() .map(|e: Result| e.unwrap()) .collect::>() .as_slice() { [] => ":clap:".to_string(), [_] => "You can't clap a single word." .split_whitespace() .collect::>() .join(" :clap: "), args => args.join(" :clap: "), }; msg.channel_id.say(ctx, resp).await?; Ok(()) }