From 3e718e60ecd12a14224c934872d1496f6effef28 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Wed, 7 Jul 2021 17:00:39 +0200 Subject: [PATCH] Edit message after update with last commit --- README.md | 2 +- commands/update.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 7797a6b..fde558f 100644 --- a/README.md +++ b/README.md @@ -29,4 +29,4 @@ If you want this feature, you have to enable it in ./data/config.json. ## Known issues -* parseMention has issues sometimes +* parseMention has issues sometimes, but I don't know what exactly causes it and when it happens. diff --git a/commands/update.js b/commands/update.js index 893707c..013536a 100644 --- a/commands/update.js +++ b/commands/update.js @@ -16,7 +16,16 @@ module.exports = { let beforeSize = client.commands.size; reloadCommands(client) let sendText = `${stdout}\nBot updated, and\n${calculateReloaded(beforeSize, client)}` - message.channel.send(sendText) + message.channel.send(sendText).then(function(msg){ + cmd = "git log --oneline -n 1"; + exec(cmd, (err, stdout, stderr) =>{ + process.stdout.write(stdout) + msg.edit(`${sendText}\n\nNewest commit:\n${stdout.split(" ")[1]}`) + if (err) console.log(stderr) + + }) + + }) } if (err) { message.channel.send("Something went wrong...");