From 2976f7d0a58ae647e2dc2c22176dbfbf866d7e02 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Sun, 16 May 2021 09:20:54 -0500 Subject: [PATCH] Add slash command for changelog --- bot/awesomescibo.js | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index 103ae7c..dca567b 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -454,7 +454,7 @@ async function hits(message) { message.channel.send(`Total Hits: ${totalCount}\nYour Hits: ${userCount}`); } -async function changelog(message) { +async function changelog(interaction) { let parentFolder = __dirname.split("/"); parentFolder.pop(); parentFolder = parentFolder.join("/"); @@ -466,7 +466,7 @@ async function changelog(message) { }); const changelogEmbed = new Discord.MessageEmbed() - .setAuthor(message.author.tag, message.author.displayAvatarURL()) + .setAuthor(interaction.user.tag, interaction.user.displayAvatarURL()) .setTitle("Changelog") .setTimestamp(); @@ -474,7 +474,7 @@ async function changelog(message) { changelogEmbed.addField(commit.abbrevHash, `> \`Hash:\`${commit.hash}\n> \`Subject:\`${commit.subject}\n> \`Author:\`${commit.authorName}\n> \`Date:\`${commit.authorDateRel}\n> \`Link\`: [GitHub](https://github.com/ADawesomeguy/AwesomeSciBo/commit/${commit.hash})\n`); }); - message.channel.send(changelogEmbed); + interaction.reply(changelogEmbed); } client.on("message", async (message) => { @@ -500,9 +500,6 @@ client.on("message", async (message) => { case "dobeabout": // Show about message of bot aboutMessage(message); break; - case "dobechangelog": - changelog(message); - break; } } });