{"size": 990, "ext": "js", "max_stars_repo_path": "commands/information/ping.js", "max_stars_repo_name": "siegmund0/SteamID64ToGUID-Discord-Bot", "max_stars_repo_stars_event_min_datetime": "2020-05-09T04:57:34.000Z", "max_stars_repo_stars_event_max_datetime": "2021-08-06T05:00:56.000Z", "max_issues_repo_path": "commands/information/ping.js", "max_issues_repo_name": "siegmund0/SteamID64ToGUID-Discord-Bot", "max_issues_repo_issues_event_min_datetime": "2020-07-30T12:13:02.000Z", "max_issues_repo_issues_event_max_datetime": "2021-07-16T00:06:30.000Z", "max_forks_repo_path": "commands/information/ping.js", "max_forks_repo_name": "siegmund0/SteamID64ToGUID-Discord-Bot", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 10, "max_issues_count": 9, "max_forks_count": null, "avg_line_length": 58.2352941176, "max_line_length": 294, "alphanum_fraction": 0.6808080808}
const { GeneralDao } = require('../../src/daos/commands.dao');
const { GeneralConstantes } = require('../../src/constants/generalConstants');
const { MessageEventService } = require('../../src/services/messageEvent.services');

module.exports = {
    name: "ping",
    aliases: ["p"],
	category: "information",
    description: "Returns the latency of the API to the server",
	usage: "-ping",
    run: async(client, message, args) => {
        await MessageEventService.enviarLogsChannel(client, message, 'ping');
        await GeneralDao.generalAlmacenamientoDao(message, 'ping', GeneralConstantes.COMANDOS)
        const msg = await message.channel.send(`Doing Ping...`)
        return msg.edit(`Pong!\nThe Server-User Latency is \`${Math.floor(msg.createdTimestamp - message.createdTimestamp)}\`ms\nAPI latency with respect to the server is \`${Math.round(client.ws.ping)}\`ms\nIf the latency is high, don't worry ... This doesn't affect the bot's performance.`);
    }
}