Новый вид для ping

This commit is contained in:
JonnyBro 2023-01-05 15:19:20 +05:00
parent 167268423a
commit 0ae13edd23
3 changed files with 20 additions and 5 deletions

View file

@ -1,4 +1,4 @@
const { SlashCommandBuilder } = require("discord.js"); const { SlashCommandBuilder, EmbedBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"); const BaseCommand = require("../../base/BaseCommand");
class Ping extends BaseCommand { class Ping extends BaseCommand {
@ -31,8 +31,21 @@ class Ping extends BaseCommand {
* @param {Object} data * @param {Object} data
*/ */
async execute(client, interaction) { async execute(client, interaction) {
interaction.replyT("general/ping:CONTENT", { const embed = new EmbedBuilder()
ping: Math.round(client.ws.ping), .setColor(client.config.embed.color)
.setFooter({
text: client.config.embed.footer,
})
.setAuthor({
name: interaction.translate("general/ping:PONG"),
iconURL: client.user.avatarURL(),
})
.setDescription(interaction.translate("general/ping:PING", {
ping: Math.round(client.ws.ping),
}));
interaction.reply({
embeds: [embed],
}); });
} }
} }

View file

@ -2,5 +2,6 @@
"DESCRIPTION": "Показать пинг бота", "DESCRIPTION": "Показать пинг бота",
"USAGE": "", "USAGE": "",
"EXAMPLES": "ping", "EXAMPLES": "ping",
"CONTENT": "Понг! Мой пинг - **{{ping}}**ms." "PONG": "Понг!",
"PING": "Мой пинг - **{{ping}}**ms"
} }

View file

@ -2,5 +2,6 @@
"DESCRIPTION": "Показати пінг бота", "DESCRIPTION": "Показати пінг бота",
"USAGE": "", "USAGE": "",
"EXAMPLES": "ping", "EXAMPLES": "ping",
"CONTENT": "Понг! Мій пінг - **{{ping}}**ms." "PONG": "Понг!",
"PING": "Мій пінг - **{{ping}}**ms"
} }