Edit message after update with last commit

This commit is contained in:
SileNce5k 2021-07-07 17:00:39 +02:00
parent 85baa09942
commit 3e718e60ec
No known key found for this signature in database
GPG key ID: C507260E7F2583AD
2 changed files with 11 additions and 2 deletions

View file

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

View file

@ -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...");