Make about and serverinfo show Git commit

This commit is contained in:
7cc5c4f330d47060 2024-07-24 02:55:10 -04:00
parent 13cfdc834c
commit a971d88ed4
2 changed files with 22 additions and 2 deletions
plugins/commands

View file

@ -5,7 +5,17 @@ module.exports = {
execute: function (c) {
c.reply({text:getMessage(c.lang,"command.about.author",[settings.name])});
c.reply({text:""});
c.reply({text:getMessage(c.lang,"command.about.version",[version.bot])});
let botVersion=version.bot;
let gitCommit;
try {
gitCommit = cp.execSync('git rev-parse --short HEAD').toString('UTF-8').split('\n')[0];
} catch(e){
gitCommit = false
}
if(gitCommit){
botVersion+=` (${gitCommit})`
}
c.reply({text:getMessage(c.lang,"command.about.version",[botVersion])});
c.reply({text:""});
c.reply({text:getMessage(c.lang,"command.about.serverinfo")})
},

View file

@ -83,6 +83,16 @@ module.exports = {
c.reply(gr(c.lang,getMessage(c.lang,"command.serverinfo.os.android.model"), dBrand+" "+dModel, 'green'))
}
c.reply(gr(c.lang,getMessage(c.lang,"command.serverinfo.botName"), settings.name, 'yellow'))
c.reply(gr(c.lang,getMessage(c.lang,"command.serverinfo.botVer"), version.bot, 'yellow'))
let botVersion=version.bot;
let gitCommit;
try {
gitCommit = cp.execSync('git rev-parse --short HEAD').toString('UTF-8').split('\n')[0];
} catch(e){
gitCommit = false
}
if(gitCommit){
botVersion+=` (${gitCommit})`
}
c.reply(gr(c.lang,getMessage(c.lang,"command.serverinfo.botVer"), botVersion, 'yellow'))
}
}