Make about and serverinfo show Git commit
This commit is contained in:
parent
13cfdc834c
commit
a971d88ed4
2 changed files with 22 additions and 2 deletions
plugins/commands
|
@ -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")})
|
||||
},
|
||||
|
|
|
@ -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'))
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue