add embed to ping.js & pass in args, cfg to commands

This commit is contained in:
2021-08-23 17:30:41 +02:00
parent f1bec2d133
commit 379e6a1108
2 changed files with 9 additions and 2 deletions

View File

@@ -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] });
}, },
}; };

View File

@@ -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--`