From 86b1fc940b2c49a14b8c87f51e1ff91392079365 Mon Sep 17 00:00:00 2001 From: Abheek Dhawan Date: Fri, 14 May 2021 11:57:31 -0500 Subject: [PATCH] First attempt of sending changelog --- bot/awesomescibo.js | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/bot/awesomescibo.js b/bot/awesomescibo.js index db7bc17..3a83830 100755 --- a/bot/awesomescibo.js +++ b/bot/awesomescibo.js @@ -437,11 +437,20 @@ async function changelog(message) { const commits = gitlog({ repo: parentFolder, - number: 20, + number: 5, fields: ["hash", "abbrevHash", "subject", "authorName", "authorDateRel"], }); - console.log(commits); + const changelogEmbed = new Discord.MessageEmbed() + .setAuthor(message.author.tag, message.author.displayAvatarURL()) + .setTitle("Changelog") + .setTimestamp(); + + commits.forEach(commit => { + changelogEmbed.addField(commit.abbrevHash, `> \`Hash:\`${commit.hash}\n> \`Subject:\`${commit.subject}\n> \`Author:\`${commit.authorName}\n> \`Date:\`${commit.authorDateRel}\n`); + }); + + message.channel.send(changelogEmbed); } client.on("message", async (message) => {