mirror of
https://github.com/arthur-pbty/flint.git
synced 2026-08-01 20:29:03 +02:00
- Implement `goodbye` command to configure goodbye messages. - Implement `help` command to provide a global help embed with command details. - Implement `kiss` command to send a kiss message to a mentioned user. - Create `memberMessagePanel` for managing welcome and goodbye messages. - Implement `ping` command to check bot latency. - Implement `presence` command to manage bot presence settings. - Implement `welcome` command to configure welcome messages.
33 lines
855 B
TypeScript
33 lines
855 B
TypeScript
/**
|
|
* Commande `ping` (utility)
|
|
*
|
|
* Répond avec un message court contenant la latence websocket du bot.
|
|
*/
|
|
import { MessageFlags } from "discord.js";
|
|
import { defineCommand } from "../framework/commands/defineCommand.js";
|
|
|
|
/** Commande `ping` — affiche la latence du bot. */
|
|
export const pingCommand = defineCommand({
|
|
meta: {
|
|
name: "ping",
|
|
category: "utility",
|
|
},
|
|
cooldown: 5,
|
|
examples: [
|
|
{
|
|
descriptionKey: "examples.basic",
|
|
},
|
|
],
|
|
execute: async (ctx) => {
|
|
const responses = (ctx.commandText.responses as Record<string, unknown> | undefined) ?? {};
|
|
const template = typeof responses.pong === "string" ? responses.pong : "Pong {{latency}}ms";
|
|
|
|
await ctx.reply({
|
|
content: ctx.format(template, {
|
|
latency: ctx.client.ws.ping,
|
|
}),
|
|
flags: [MessageFlags.Ephemeral],
|
|
});
|
|
},
|
|
});
|