From 95ec639f3ea1431344837144d110f43cbbc195b3 Mon Sep 17 00:00:00 2001 From: Gavin Isgar Date: Mon, 1 Oct 2018 17:05:09 -0400 Subject: [PATCH] Add machine information command Added the "/ratz machineinfo" command for users to see which system the bot is currently running off of --- main.js | 11 +++++++++++ main.ts | 11 +++++++++++ 2 files changed, 22 insertions(+) diff --git a/main.js b/main.js index 790406c..db0754b 100644 --- a/main.js +++ b/main.js @@ -51,6 +51,7 @@ var commands = require("./commands.json"); //var tokens = require("./exclude/tokens.json"); var tokens = require("C:/Users/Gavin/Desktop/tokens.json"); var fs = require("fs"); +var os = require("os"); var readline = require("readline"); var packagefile = require("./package.json"); var _a = require('electron'), app = _a.app, BrowserWindow = _a.BrowserWindow; @@ -243,6 +244,16 @@ bot.on('message', function (message) { } }); } + if (message.content.toString() == "/ratz machineinfo") { + var embed = new Discord.RichEmbed() + .setTitle("ratzBot Machine Information") + .setDescription("Information of the current machine running **ratzBot**.") + .setColor(0xcb00ff) + .addField("Machine Architecture", os.arch().toString()) + .addField("Machine CPU", os.cpus().model.toString()) + .addField("OS Type", os.type().toString()) + .addField("Uptime", os.uptime().toString()); + } if (message.content.startsWith("/ratz gituserinfo ")) { var result = message.content.slice(18); var getGitUserInfo = { diff --git a/main.ts b/main.ts index c4c6f7e..eeaabf1 100644 --- a/main.ts +++ b/main.ts @@ -17,6 +17,7 @@ var commands = require("./commands.json"); //var tokens = require("./exclude/tokens.json"); var tokens = require("C:/Users/Gavin/Desktop/tokens.json"); var fs = require("fs"); +var os = require("os"); var readline = require("readline"); var packagefile = require("./package.json"); var _a = require('electron'), app = _a.app, BrowserWindow = _a.BrowserWindow; @@ -209,6 +210,16 @@ bot.on('message', function (message) { } }); } + if (message.content.toString() == "/ratz machineinfo") { + var embed = new Discord.RichEmbed() + .setTitle("ratzBot Machine Information") + .setDescription("Information of the current machine running **ratzBot**.") + .setColor(0xcb00ff) + .addField("Machine Architecture", os.arch().toString()) + .addField("Machine CPU", os.cpus().model.toString()) + .addField("OS Type", os.type().toString()) + .addField("Uptime", os.uptime().toString()) + } if (message.content.startsWith("/ratz gituserinfo ")) { var result = message.content.slice(18); var getGitUserInfo = {