-
-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
⚒️ Update to be able to use with the new system
- Loading branch information
Showing
60 changed files
with
4,053 additions
and
3,615 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,55 +1,58 @@ | ||
module.exports.run = async (client, message, args) => { | ||
const msg = await message.channel.send(client.translate.commands.ping.waiting); | ||
const ping = Math.round((msg.createdTimestamp - message.createdTimestamp) - client.ws.ping); | ||
const api = Math.round(client.ws.ping); | ||
const { EmbedBuilder } = require("discord.js"); | ||
|
||
msg.edit({ | ||
"content": client.translate.commands.ping.result, | ||
"embeds": [ | ||
{ | ||
"title": client.translate.commands.ping.connection, | ||
"description": client.translate.commands.ping.info.replace("%s1", ping).replace("%s2", api) | ||
} | ||
] | ||
}); | ||
}; | ||
|
||
module.exports.help = { | ||
module.exports = { | ||
"name": "ping", | ||
"description": "Check the ping and api latency of the bot.", | ||
"usage": "ping", | ||
"category": "developer", | ||
"aliases": ["ปิง", "การเชื่อมต่อ"], | ||
"clientPermissions": ["SEND_MESSAGES"] | ||
"permissions": { | ||
"client": ["SEND_MESSAGES"] | ||
} | ||
}; | ||
|
||
module.exports.command = { | ||
"enable": true, | ||
"usage": "ping", | ||
"aliases": ["ปิง", "การเชื่อมต่อ"], | ||
async execute(client, message, args) { | ||
const msg = await message.channel.send(client.translate.commands.ping.waiting); | ||
const ping = Math.round((msg.createdTimestamp - message.createdTimestamp) - client.ws.ping); | ||
const api = Math.round(client.ws.ping); | ||
const pingEmbed = new EmbedBuilder() | ||
.setTitle(client.translate.commands.ping.connection) | ||
.setDescription(client.translate.commands.ping.info.replace("%s1", ping).replace("%s2", api)) | ||
|
||
msg.edit({ | ||
"content": client.translate.commands.ping.result, | ||
"embeds": [pingEmbed] | ||
}); | ||
} | ||
} | ||
|
||
module.exports.interaction = { | ||
"enable": true, | ||
"data": { | ||
"name": module.exports.help.name, | ||
"name": module.exports.name, | ||
"name_localizations": { | ||
"en-US": "ping", | ||
"th": "ปิง" | ||
}, | ||
"description": module.exports.help.description, | ||
"description": module.exports.description, | ||
"description_localizations": { | ||
"en-US": "Check the ping and api latency of the bot.", | ||
"th": "ตรวจสอบความหน่วงและ API Latency ของบอท" | ||
} | ||
}, | ||
async execute(interaction) { | ||
await interaction.editReply(interaction.client.translate.commands.ping.waiting); | ||
|
||
const ping = Math.round((Date.now() - interaction.createdTimestamp) - interaction.client.ws.ping); | ||
const msg = await interaction.editReply(interaction.client.translate.commands.ping.waiting); | ||
const ping = Math.round((msg.createdTimestamp - interaction.createdTimestamp) - interaction.client.ws.ping); | ||
const api = Math.round(interaction.client.ws.ping); | ||
const pingEmbed = new EmbedBuilder() | ||
.setTitle(interaction.client.translate.commands.ping.connection) | ||
.setDescription(interaction.client.translate.commands.ping.info.replace("%s1", ping).replace("%s2", api)) | ||
|
||
await interaction.editReply({ | ||
"content": interaction.client.translate.commands.ping.result, | ||
"embeds": [ | ||
{ | ||
"title": interaction.client.translate.commands.ping.connection, | ||
"description": interaction.client.translate.commands.ping.info.replace("%s1", ping).replace("%s2", api) | ||
} | ||
] | ||
"embeds": [pingEmbed] | ||
}); | ||
} | ||
}; | ||
} |
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
Oops, something went wrong.