forked from Supositware/Haha-Yes
Merge branch 'master' of https://gitlab.com/loicbersier/discordbot
commit
de84de13e9
@ -1,16 +0,0 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
module.exports = class listEmoteCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'listemote',
|
||||
group: 'utility',
|
||||
memberName: 'listemote',
|
||||
description: `List the emotes available on the server`,
|
||||
});
|
||||
}
|
||||
|
||||
async run(message) {
|
||||
const emojiList = message.guild.emojis.map((e, x) => (x + ' = ' + e) + ' | ' +e.name).join('\n');
|
||||
message.channel.send(emojiList);
|
||||
}
|
||||
};
|
@ -0,0 +1,34 @@
|
||||
const { oneLine } = require('common-tags');
|
||||
const { Command } = require('discord.js-commando');
|
||||
|
||||
module.exports = class PingCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'ping',
|
||||
group: 'util',
|
||||
memberName: 'ping',
|
||||
description: 'Checks the bot\'s ping to the Discord server.',
|
||||
throttling: {
|
||||
usages: 5,
|
||||
duration: 10
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
async run(msg) {
|
||||
if(!msg.editable) {
|
||||
const pingMsg = await msg.say('Pinging...');
|
||||
return pingMsg.edit(oneLine`
|
||||
${msg.channel.type !== 'dm' ? `${msg.author},` : ''}
|
||||
<:ping:499226870047571978> Pong! The message round-trip took **${pingMsg.createdTimestamp - msg.createdTimestamp}**ms.
|
||||
${this.client.ping ? `The heartbeat ping is **${Math.round(this.client.ping)}**ms.` : ''}
|
||||
`);
|
||||
} else {
|
||||
await msg.edit('Pinging...');
|
||||
return msg.edit(oneLine`
|
||||
Pong! The message round-trip took **${msg.editedTimestamp - msg.createdTimestamp}**ms.
|
||||
${this.client.ping ? `The heartbeat ping is **${Math.round(this.client.ping)}**ms.` : ''}
|
||||
`);
|
||||
}
|
||||
}
|
||||
};
|
Loading…
Reference in New Issue