diff --git a/commands/admin/update.js b/commands/admin/update.js index ad79b11..797944a 100644 --- a/commands/admin/update.js +++ b/commands/admin/update.js @@ -1,4 +1,5 @@ const calculateReloaded = require("../../util/calculateReloaded"); +const executeCommand = require("../../util/executeCommand"); const reloadCommands = require("../../util/reloadCommands"); module.exports = { @@ -31,6 +32,7 @@ module.exports = { sendText = `${sendText}\n... Message is too long to show everything` } message.channel.send(sendText) + client.githash = executeCommand(`git`, ["rev-parse", "--short", "HEAD"]) if (err) console.log(stderr) }) } diff --git a/commands/info/botinfo.js b/commands/info/botinfo.js index 843b465..f1ebebe 100644 --- a/commands/info/botinfo.js +++ b/commands/info/botinfo.js @@ -15,7 +15,8 @@ module.exports = { `Total Members: ${guildInfo.totalMembers}`, `Total Commands: ${client.commands.size}`, `Creation Date: ${getCreationDate(client)}`, - `Source: [Click Here](https://github.com/SileNce5k/discord_bot)` + `Source: [Click Here](https://github.com/SileNce5k/discord_bot)`, + `Current Version: ${client.githash}` ] let description = ""; diff --git a/server.js b/server.js index 871dc93..c8f5d8b 100644 --- a/server.js +++ b/server.js @@ -1,6 +1,7 @@ const fs = require('fs'); const createInitialConfig = require("./util/createInitialConfig") const convertJSONToSQL = require('./util/timer/convertJSONToSQL'); +const executeCommand = require('./util/executeCommand.js'); const sqlite3 = require('sqlite3').verbose(); if(!fs.existsSync("./data/config.json")) { createInitialConfig(); @@ -55,6 +56,7 @@ createAndLoadWhitelistTable(client.whitelist); client.settings.set("presenceType", presenceType); client.settings.set("presenceText", presenceText); client.settings.set("globalPrefix", globalPrefix); +client.githash = executeCommand(`git`, ["rev-parse", "--short", "HEAD"]) const reloadCommands = require("./util/reloadCommands.js"); const onMessage = require('./server/message');