Réécriture complète 4.0
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
Some checks failed
Build and Push Docker Image / build-and-push (push) Failing after 6m16s
This commit is contained in:
@@ -1,11 +1,17 @@
|
||||
import { SlashCommandBuilder, ChatInputCommandInteraction } from 'discord.js'
|
||||
|
||||
export default {
|
||||
data: new SlashCommandBuilder()
|
||||
.setName('ping')
|
||||
.setDescription('Check the latency of the bot'),
|
||||
async execute(interaction: ChatInputCommandInteraction) {
|
||||
let sent = await interaction.reply({ content: 'Pinging...', fetchReply: true })
|
||||
interaction.editReply(`Websocket heartbeat: ${interaction.client.ws.ping}ms.\nRoundtrip latency: ${sent.createdTimestamp - interaction.createdTimestamp}ms`)
|
||||
}
|
||||
}
|
||||
import { SlashCommandBuilder } from "discord.js"
|
||||
import type { ChatInputCommandInteraction } from "discord.js"
|
||||
import { t } from "@/utils/i18n"
|
||||
|
||||
export const data = new SlashCommandBuilder()
|
||||
.setName("ping")
|
||||
.setDescription("Check the latency of the bot")
|
||||
.setDescriptionLocalizations({ fr: "Vérifier la latence du bot" })
|
||||
|
||||
export async function execute(interaction: ChatInputCommandInteraction) {
|
||||
await interaction.reply({ content: t(interaction.locale, "ping.pinging") })
|
||||
const sent = await interaction.fetchReply()
|
||||
return interaction.editReply(t(interaction.locale, "ping.response", {
|
||||
heartbeat: interaction.client.ws.ping.toString(),
|
||||
latency: (sent.createdTimestamp - interaction.createdTimestamp).toString()
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user