add embed to ping.js & pass in args, cfg to commands
This commit is contained in:
@@ -1,6 +1,13 @@
|
|||||||
module.exports = {
|
module.exports = {
|
||||||
name: 'ping',
|
name: 'ping',
|
||||||
execute(msg) {
|
execute(msg, args, cfg) {
|
||||||
|
const pingembed = {
|
||||||
|
color: cfg.hexBlue,
|
||||||
|
title: `ping`,
|
||||||
|
timestamp: new Date(),
|
||||||
|
description: `Pong! ${Date.now() - msg.createdTimestamp}`,
|
||||||
|
};
|
||||||
msg.channel.send(`pong`);
|
msg.channel.send(`pong`);
|
||||||
|
msg.channel.send({ embeds: [pingembed] });
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ cl.on('messageCreate', (msg) => {
|
|||||||
const cmd = cl.cmds.get(cmdName);
|
const cmd = cl.cmds.get(cmdName);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
cmd.execute(msg);
|
cmd.execute(msg, args, cfg);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error(
|
console.error(
|
||||||
`msgCommand error: ${cmdName} by ${msg.author.tag}\n--\n${error}\n--`
|
`msgCommand error: ${cmdName} by ${msg.author.tag}\n--\n${error}\n--`
|
||||||
|
|||||||
Reference in New Issue
Block a user