master
Kit Kasune 3 years ago
parent 63014160df
commit 74d5abe8ca
  1. 22
      commands/misc/ping.js
  2. 3
      events/messageCreate.js

@ -0,0 +1,22 @@
const Discord = require('discord.js');
module.exports = {
name: "ping",
aliases: [],
meta: {
category: 'Misc',
description: "Find out Natsuki's latency",
syntax: '`ping`',
extra: null
},
help: "Definitely not much to see here...",
async execute(message, msg, args, cmd, prefix, mention, client) {
return message.channel.send({embeds: [new Discord.MessageEmbed()
.setTitle("Client Latency")
.setDescription(`Response Latency: \`${new Date().getTime() - message.createdTimestamp}ms\`\nAPI Latency: \`${client.ws.ping}ms\``)
.setFooter({text: "Natsuki", iconURL: client.user.avatarURL()})
.setTimestamp()
.setColor('c375f0')
]});
}
};

@ -117,9 +117,8 @@ module.exports = async (client, message) => {
if (!command) {let trigger; for (trigger of client.responses.triggers) {if (await trigger[1](message, msg, args, cmd, prefix, mention, client)) {await client.responses.commands.get(trigger[0]).execute(message, msg, args, cmd, prefix, mention, client); break;}} return;} if (!command) {let trigger; for (trigger of client.responses.triggers) {if (await trigger[1](message, msg, args, cmd, prefix, mention, client)) {await client.responses.commands.get(trigger[0]).execute(message, msg, args, cmd, prefix, mention, client); break;}} return;}
if (message.guild && !message.channel.permissionsFor(client.user.id).has('SEND_MESSAGES')) {return message.author.send(`You tried to run the \`${command.name}\` command, but I don't seem to be able to send messages in <#${message.channel.id}>, so I can't do that!`).catch(() => {});}; if (message.guild && !message.channel.permissionsFor(client.user.id).has('SEND_MESSAGES')) {return message.author.send(`You tried to run the \`${command.name}\` command, but I don't seem to be able to send messages in <#${message.channel.id}>, so I can't do that!`).catch(() => {});};
message.channel.sendTyping().catch(() => {}); await message.channel.sendTyping().catch(() => {});
if (!require('../util/cooldownhandler')(client, message, command)) {return;} if (!require('../util/cooldownhandler')(client, message, command)) {return;}
await wait(500);
if (command.meta && command.meta.guildOnly && !message.guild) {return message.channel.send("You must be in a server to use this command!").catch(() => {});} if (command.meta && command.meta.guildOnly && !message.guild) {return message.channel.send("You must be in a server to use this command!").catch(() => {});}
require('../util/oncommand')(message, msg, args, cmd, prefix, mention, client); require('../util/oncommand')(message, msg, args, cmd, prefix, mention, client);
if (client.misc.loggers.cmds) {client.misc.loggers.cmds.send(`${chalk.gray("[CMDL]")} >> ${chalk.white("Command")} ${chalk.blue(command.name)} ${message.guild ? `|| ${chalk.blue("Guild ID: ")} ${chalk.blueBright(message.guild.id)}` : ''} || ${chalk.blue("User ID: ")} ${chalk.blueBright(message.author.id)}`);} if (client.misc.loggers.cmds) {client.misc.loggers.cmds.send(`${chalk.gray("[CMDL]")} >> ${chalk.white("Command")} ${chalk.blue(command.name)} ${message.guild ? `|| ${chalk.blue("Guild ID: ")} ${chalk.blueBright(message.guild.id)}` : ''} || ${chalk.blue("User ID: ")} ${chalk.blueBright(message.author.id)}`);}

Loading…
Cancel
Save