-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Додано папку `locales` яка містить рядки локалізації, проведено локалізацію подій, команд, компонентів відповідно до рядків локалізації..
- Loading branch information
1 parent
d5b4b38
commit 75beba0
Showing
33 changed files
with
826 additions
and
330 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,23 +1,33 @@ | ||
const { SlashCommandBuilder } = require("discord.js"); | ||
const { t } = require("i18next"); | ||
|
||
/** | ||
* @type {import('../../typings').Command} | ||
*/ | ||
module.exports = { | ||
data: new SlashCommandBuilder() | ||
.setName("ping") | ||
.setDescription("Ping Pong.") | ||
.setDescription(t('commands:info.ping.description', { lng: "en-US" })) | ||
.setDescriptionLocalizations({ | ||
'en-GB': t('commands:info.ping.description', { lng: "en-GB" }), | ||
uk: t('commands:info.ping.description', { lng: "uk" }), | ||
ru: t('commands:info.ping.description', { lng: "ru" }) | ||
}) | ||
.setDMPermission(false), | ||
options: { | ||
cooldown: 30, | ||
ownerOnly: false, | ||
devGuildOnly: true, | ||
cooldown: 0, | ||
bot_permissions: ["ViewChannel", "SendMessages"], | ||
}, | ||
|
||
async execute(interaction) { | ||
const { client } = interaction; | ||
|
||
await interaction.reply({ content: `Pong!\nWebsocket ping: **${client.ws.ping}**ms`, ephemeral: true }); | ||
await interaction.deferReply() | ||
|
||
const reply = await interaction.fetchReply() | ||
|
||
await interaction.editReply({ content: t('commands:info.ping.content', { lng: interaction.locale, ping: Math.round(client.ws.ping), latency: Math.round(reply.createdTimestamp - interaction.createdTimestamp) }) }); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @type {import("../../../typings").Button} | ||
*/ | ||
module.exports = { | ||
name: "sample", | ||
type: "button", | ||
|
||
async execute(interaction) { | ||
if (!interaction.isButton()) return; | ||
|
||
return interaction.reply({ content: `${interaction.customId}`, ephemeral: true }); | ||
}, | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
/** | ||
* @type {import("../../../typings").Button} | ||
*/ | ||
module.exports = { | ||
name: "say_hello", | ||
type: "button", | ||
|
||
async execute(interaction) { | ||
if (!interaction.isButton()) return; | ||
|
||
return interaction.reply({ content: `Hello, ${interaction.user}!`, ephemeral: true }); | ||
}, | ||
}; |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.