Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/commands/prefix/ping.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { pingMessages } from '@/lang/ping.js';
import { pingDescription, pingMessages } from '@/lang/ping.js';
import { Container, render } from '@/lib/components/container.js';
import { Separator } from '@/lib/components/separator.js';
import { Text } from '@/lib/components/text.js';
Expand All @@ -7,6 +7,7 @@ import { PrefixCommand } from '@/types/command.js';

export const command: PrefixCommand = {
name: 'ping',
description: pingDescription,
aliases: ['p', 'latency'],

async execute(message, _args) {
Expand Down
4 changes: 2 additions & 2 deletions src/commands/slash/ping.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { SlashCommandBuilder } from 'discord.js';
import { pingMessages } from '@/lang/index.js';
import { pingDescription, pingMessages } from '@/lang/index.js';
import type { SlashCommand } from '@/types/command.js';
import { Container } from '@/lib/components/container.js';
import { Text } from '@/lib/components/text.js';
Expand All @@ -9,7 +9,7 @@ import { Title } from '@/lib/components/title.js';
export const command: SlashCommand = {
data: new SlashCommandBuilder()
.setName('ping')
.setDescription('Affiche la latence du bot.'),
.setDescription(pingDescription),

async execute(interaction) {
const before = Date.now();
Expand Down
2 changes: 1 addition & 1 deletion src/lang/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export { pingMessages } from './ping.js';
export { pingMessages, pingDescription } from './ping.js';
2 changes: 2 additions & 0 deletions src/lang/ping.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,5 @@ export const pingMessages = {
result: (totalMs: number, discordMs: number): string =>
`Latence totale : ${totalMs} ms\nLatence Discord : ${discordMs} ms`,
} as const;

export const pingDescription = 'Affiche la latence du bot.' as const;
1 change: 1 addition & 0 deletions src/types/command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ export interface SlashCommand {

export interface PrefixCommand {
name: string;
description: string;
aliases?: string[];
execute(interaction: Message, args: string[]): Promise<void>;
Comment on lines 13 to 17
}