Skip to content

Commit

Permalink
Close #83 by adding a guide link (and a slight refactor to make confi…
Browse files Browse the repository at this point in the history
…g easier... maybe that should be server cache?)
  • Loading branch information
jakethedev committed Dec 15, 2021
1 parent f3fd049 commit bff1a36
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
const fs = require('fs')
const debug = (msg) => console.log(`MAIN: ${msg}`)
// Config
const { botkey, activeChannels, gameStatus } = JSON.parse(fs.readFileSync('config.json', 'utf-8'))
const { botkey, activeChannels, gameStatus } = require('./util/config')
const { token } = JSON.parse(fs.readFileSync('.token.json', 'utf-8'))
// Instantiating the manifold
const discord = require('discord.js')
Expand Down
16 changes: 11 additions & 5 deletions commands/syslib/sysinfo.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,19 @@
const os = require('os')
const MBinB = 1048576
const rand = require('../../util/random')
const config = require('../../config')
const config = require('../../util/config')

// Handy guide link for easy pinning
exports.guide = function() {
return `Check out the **always-updated guide** on Github at ${config.guidelink}!`
}

// Simple version, bug link, and release notes output
exports.version = function() {
let response = `I am BeatBattleBot v**${config.version}**!\n\n`
response += `**Release notes**\n${config.releasenotes}\n\n`
response += `**Bug or feature request? Drop it here!**\n${config.issuelink}\n`
let response = `I am BeatBattleBot version **${config.version}**!\n\n`
response += `**HOW TO USE THE BOT:**\n<${config.guidelink}>\n\n`
response += `**Release notes:**\n${config.releasenotes}\n\n`
response += `**Bug or feature request? Drop it here:**\n<${config.issuelink}>\n`
return response
}

Expand All @@ -23,7 +29,7 @@ exports.serverstats = function() {
let free = Math.round(os.freemem() / MBinB)
let max = Math.round(os.totalmem() / MBinB)
let uptime = Math.round(os.uptime() / 3600.0)
let desire = rand.choice(['raise', 'smoothie', 'piece of cake', 'new synth plugin', 'massage', 'day off', 'new manager', 'new xlr cable', 'hammer and some balloons'])
let desire = rand.choice(['goldfish', 'new synth', 'free collab', 'repost on instagram', 'raise', 'smoothie', 'piece of cake', 'new synth plugin', 'massage', 'day off', 'new manager', 'new xlr cable', 'hammer and some balloons'])
return `I've been awake for ${uptime} hours, my workload looks like ${load}, I've got ${free} MB free of ${max}, and I really want a ${desire} - thanks for asking.`
}
}
5 changes: 3 additions & 2 deletions config.json → util/config.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
{
module.exports = {
"version": "1.10.0",
"releasenotes": "Voting, stability, and simplicity were the big changes this time around",
"releasenotes": "!guide for a link to the command list",
"issuelink": "https://github.com/jakethedev/beatbattlebot/issues",
"guidelink": "https://gist.github.com/jakethedev/82865525164fb7fc64117751611bf597",
"botkey": "!",
"activeChannels": [
"bot",
Expand Down

0 comments on commit bff1a36

Please sign in to comment.