refactor(commands/utils): formatting using rustfmt on ping

This commit is contained in:
Raphael 2026-02-14 00:45:47 +01:00
parent 1b1f3ae9d3
commit ee99b6c4c4
No known key found for this signature in database

View file

@ -1,9 +1,6 @@
use std::time::Instant; use std::time::Instant;
use crate::commands::{ use crate::commands::{CommandEntry, SlashCommand};
CommandEntry,
SlashCommand,
};
use serenity::all::{ use serenity::all::{
CommandInteraction, Context, CreateCommand, CreateInteractionResponse, CommandInteraction, Context, CreateCommand, CreateInteractionResponse,
@ -25,11 +22,15 @@ impl SlashCommand for Ping {
fn register(&self) -> CreateCommand { fn register(&self) -> CreateCommand {
println!("\t✅ | {}", self.name()); println!("\t✅ | {}", self.name());
CreateCommand::new(self.name()) CreateCommand::new(self.name()).description(self.description())
.description(self.description())
} }
async fn run(&self, ctx: &Context, command: &CommandInteraction, _database: &PgPool) -> Result<(), serenity::Error> { async fn run(
&self,
ctx: &Context,
command: &CommandInteraction,
_database: &PgPool,
) -> Result<(), serenity::Error> {
let message: CreateInteractionResponseMessage = CreateInteractionResponseMessage::new() let message: CreateInteractionResponseMessage = CreateInteractionResponseMessage::new()
.content("🏓 | Pong!") .content("🏓 | Pong!")
.ephemeral(true); .ephemeral(true);
@ -40,8 +41,8 @@ impl SlashCommand for Ping {
command.create_response(&ctx.http, response).await?; command.create_response(&ctx.http, response).await?;
let delta_time: u128 = start.elapsed().as_millis(); let delta_time: u128 = start.elapsed().as_millis();
let edit_msg: EditInteractionResponse = EditInteractionResponse::new() let edit_msg: EditInteractionResponse =
.content(format!("Ping: **{delta_time}**ms")); EditInteractionResponse::new().content(format!("Ping: **{delta_time}**ms"));
command.edit_response(&ctx.http, edit_msg).await?; command.edit_response(&ctx.http, edit_msg).await?;