Prefix is now in a json file and new command

This commit is contained in:
Andrew Lee 2019-10-21 20:31:12 +00:00
parent 352bdfba73
commit 452bede903
5 changed files with 39 additions and 9 deletions

7
.gitignore vendored
View file

@ -28,9 +28,4 @@ build/Release
node_modules node_modules
config.json config.json
*.json json.sqlite
*.sqlite
package.json
package-lock.json
*.json

3
assets/settings.json Normal file
View file

@ -0,0 +1,3 @@
{
"prefix": "p:"
}

View file

@ -10,11 +10,12 @@
exports.run = (bot, msg, args) => { exports.run = (bot, msg, args) => {
const { RichEmbed } = require('discord.js'); const { RichEmbed } = require('discord.js');
if (!args[0]) { if (!args[0]) {
const settings = require("../../assets/settings.json");
const embed = new RichEmbed(); const embed = new RichEmbed();
embed embed
.setColor (0x36393e) .setColor (0x36393e)
.setTitle('PokeBot Command List') .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.`); .setFooter(`PokeBot v1.0 is on ${bot.guilds.size} servers.`);
const categories = Array.from(bot.categories.keys()); const categories = Array.from(bot.categories.keys());

31
commands/Utility/hinfo.js Normal file
View file

@ -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.',
};

View file

@ -27,8 +27,8 @@ module.exports = (bot, msg) => {
function parseCommand(bot, msg) { function parseCommand(bot, msg) {
let category; let category;
const settings = require("../assets/settings.json");
const prefix = 'p:'; const prefix = settings.prefix;
if (msg.author.bot) return; if (msg.author.bot) return;
if (!msg.content.startsWith(prefix)) return; if (!msg.content.startsWith(prefix)) return;