{"size": 704, "ext": "js", "max_stars_repo_path": "commands/General/ping.js", "max_stars_repo_name": "James-Hackett/DiscordBot", "max_stars_repo_stars_event_min_datetime": "2021-02-13T00:34:23.000Z", "max_stars_repo_stars_event_max_datetime": "2021-12-24T12:41:04.000Z", "max_issues_repo_path": "commands/General/ping.js", "max_issues_repo_name": "DistroByte/ComfyBot", "max_issues_repo_issues_event_min_datetime": "2021-02-22T22:45:58.000Z", "max_issues_repo_issues_event_max_datetime": "2022-01-26T02:16:15.000Z", "max_forks_repo_path": "commands/General/ping.js", "max_forks_repo_name": "James-Hackett/ComfyBot", "max_forks_repo_forks_event_min_datetime": "2021-04-04T22:20:44.000Z", "max_forks_repo_forks_event_max_datetime": "2021-10-02T23:40:03.000Z"}
{"max_stars_count": 9, "max_issues_count": 38, "max_forks_count": 2, "avg_line_length": 25.1428571429, "max_line_length": 143, "alphanum_fraction": 0.5866477273}
const Command = require("../../base/Command.js");

class Ping extends Command {

  constructor(client) {
    super(client, {
      name: "ping",
      description: "Show bot's ping",
      dirname: __dirname,
      enabled: true,
      guildOnly: false,
      aliases: ["pong", "latency"],
      memberPermissions: [],
      botPermissions: ["SEND_MESSAGES"],
      nsfw: false,
      ownerOnly: false,
      cooldown: 1000
    });
  }

  async run(message) {
    message.success("Pong! My ping is `...ms`.").then((m) => {
      m.edit(`Pong! My ping is \`${m.createdTimestamp - message.createdTimestamp}ms\`. API Latency: \`${Math.round(this.client.ws.ping)}ms\``);
    });
  }
}

module.exports = Ping;