diff options
| author | Alee <Alee14498@gmail.com> | 2019-10-21 20:31:12 +0000 |
|---|---|---|
| committer | Alee <Alee14498@gmail.com> | 2019-10-21 20:31:12 +0000 |
| commit | 452bede9036af8db1b25f8c21939e22626db380a (patch) | |
| tree | cc93d9cbc6451519b42604297a173320d8ad145c | |
| parent | 352bdfba73f1e52b61f59c30bd4142f1ffe07d65 (diff) | |
| download | PokeBot-452bede9036af8db1b25f8c21939e22626db380a.tar.gz PokeBot-452bede9036af8db1b25f8c21939e22626db380a.tar.bz2 PokeBot-452bede9036af8db1b25f8c21939e22626db380a.zip | |
Prefix is now in a json file and new command
| -rw-r--r-- | .gitignore | 7 | ||||
| -rw-r--r-- | assets/settings.json | 3 | ||||
| -rw-r--r-- | commands/Getting Started/help.js | 3 | ||||
| -rw-r--r-- | commands/Utility/hinfo.js | 31 | ||||
| -rw-r--r-- | events/message.js | 4 |
5 files changed, 39 insertions, 9 deletions
@@ -28,9 +28,4 @@ build/Release node_modules config.json -*.json -*.sqlite - -package.json -package-lock.json -*.json +json.sqlite diff --git a/assets/settings.json b/assets/settings.json new file mode 100644 index 0000000..8eb10c1 --- /dev/null +++ b/assets/settings.json @@ -0,0 +1,3 @@ +{ + "prefix": "p:" +}
\ No newline at end of file diff --git a/commands/Getting Started/help.js b/commands/Getting Started/help.js index 4ee6ce5..1fb2101 100644 --- a/commands/Getting Started/help.js +++ b/commands/Getting Started/help.js @@ -10,11 +10,12 @@ exports.run = (bot, msg, args) => { const { RichEmbed } = require('discord.js'); if (!args[0]) { + const settings = require("../../assets/settings.json"); const embed = new RichEmbed(); embed .setColor (0x36393e) .setTitle('PokeBot Command List') - .setDescription('PokeBot prefix is `p:`.') + .setDescription(`PokeBot prefix is \`${settings.prefix}\`.`) .setFooter(`PokeBot v1.0 is on ${bot.guilds.size} servers.`); const categories = Array.from(bot.categories.keys()); diff --git a/commands/Utility/hinfo.js b/commands/Utility/hinfo.js new file mode 100644 index 0000000..982a3bf --- /dev/null +++ b/commands/Utility/hinfo.js @@ -0,0 +1,31 @@ +/** ************************************** + * + * Host Info: Plugin for PokeBot that provides the information of the host. + * Copyright (C) 2018 TheEdge, jtsshieh, Alee + * + * Licensed under the Open Software License version 3.0 + * + * *************************************/ + +exports.run = (bot, msg) => { + const { RichEmbed } = require('discord.js'); + const os = require('os'); + const embed = new RichEmbed() + .setTitle('Information on PokeBot\'s Host') + .addField('OS Hostname: ', os.hostname() , true) + .addField('NodeJS Version: ', process.versions.node , true) + .addField('OS Platform: ', os.platform() , true) + .addField('OS Version: ', os.release() , true) + .setColor('#000000'); + msg.channel.send({embed}); +}; + +exports.conf = { + aliases: [], + guildOnly: true, +}; + +exports.help = { + name: 'hinfo', + description: 'Gives host information to user.', +}; diff --git a/events/message.js b/events/message.js index 238d95e..d485ed3 100644 --- a/events/message.js +++ b/events/message.js @@ -27,8 +27,8 @@ module.exports = (bot, msg) => { function parseCommand(bot, msg) { let category; - - const prefix = 'p:'; + const settings = require("../assets/settings.json"); + const prefix = settings.prefix; if (msg.author.bot) return; if (!msg.content.startsWith(prefix)) return; |
