From 379e6a1108bfcff66cd8b3c7892d26eec572620e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Ma=C5=84czak?= <56172798+jakubmanczak@users.noreply.github.com> Date: Mon, 23 Aug 2021 17:30:41 +0200 Subject: [PATCH] add embed to ping.js & pass in args, cfg to commands --- src/cmds/ping.js | 9 ++++++++- src/index.js | 2 +- 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/cmds/ping.js b/src/cmds/ping.js index 5d05d32..5c6fac4 100644 --- a/src/cmds/ping.js +++ b/src/cmds/ping.js @@ -1,6 +1,13 @@ module.exports = { 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({ embeds: [pingembed] }); }, }; diff --git a/src/index.js b/src/index.js index ac8d3ca..cf11de5 100644 --- a/src/index.js +++ b/src/index.js @@ -27,7 +27,7 @@ cl.on('messageCreate', (msg) => { const cmd = cl.cmds.get(cmdName); try { - cmd.execute(msg); + cmd.execute(msg, args, cfg); } catch (error) { console.error( `msgCommand error: ${cmdName} by ${msg.author.tag}\n--\n${error}\n--`