Added help command
This commit is contained in:
@@ -27,6 +27,7 @@ function addCommand(name, command, alt, usage, desc, requrePerms, functionRefere
|
|||||||
/*command name, command, alt, usage, description, require permission, reference*/
|
/*command name, command, alt, usage, description, require permission, reference*/
|
||||||
module.exports.loadCommands = function() {
|
module.exports.loadCommands = function() {
|
||||||
//general commands
|
//general commands
|
||||||
|
addCommand('Help', 'help', undefined, 'help [command] or [help]', 'returns a usage chart for the command requested, or returns a link to a command list', false, Commands.help);
|
||||||
addCommand('Say', 'say', undefined, 'say [input]', 'repeats the input', false, Commands.say);
|
addCommand('Say', 'say', undefined, 'say [input]', 'repeats the input', false, Commands.say);
|
||||||
addCommand('Version', 'version', undefined, 'version', 'returns the version', false, Commands.version);
|
addCommand('Version', 'version', undefined, 'version', 'returns the version', false, Commands.version);
|
||||||
addCommand('Ping', 'ping', undefined, 'ping', 'returns round trip to discords servers', false, Commands.ping);
|
addCommand('Ping', 'ping', undefined, 'ping', 'returns round trip to discords servers', false, Commands.ping);
|
||||||
@@ -39,6 +40,6 @@ module.exports.loadCommands = function() {
|
|||||||
addCommand('Rule', 'rule', undefined, 'rule [rule number]', 'returns corresponding rule for the server the command was issued on', false, RuleCommands.rule);
|
addCommand('Rule', 'rule', undefined, 'rule [rule number]', 'returns corresponding rule for the server the command was issued on', false, RuleCommands.rule);
|
||||||
addCommand('AddRule', 'addrule', undefined, 'addrule [new rule]', 'adds a rule to the rule list for the server the command was issued on', true, RuleCommands.addrule);
|
addCommand('AddRule', 'addrule', undefined, 'addrule [new rule]', 'adds a rule to the rule list for the server the command was issued on', true, RuleCommands.addrule);
|
||||||
addCommand('DelRule', 'delrule', undefined, 'delrule [rule number]', 'deletes the corresponding rule for the server the command was issued on', true, RuleCommands.delrule);
|
addCommand('DelRule', 'delrule', undefined, 'delrule [rule number]', 'deletes the corresponding rule for the server the command was issued on', true, RuleCommands.delrule);
|
||||||
addCommand('EditRule', 'editrule', undefined, 'editrule [rune number] [new rule]', 'edits the corresponding rule for the server the command was issued on', true, RuleCommands.editrule);
|
addCommand('EditRule', 'editrule', undefined, 'editrule [rule number] [new rule]', 'edits the corresponding rule for the server the command was issued on', true, RuleCommands.editrule);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
0
commands/admincommands.js
Normal file
0
commands/admincommands.js
Normal file
@@ -2,10 +2,35 @@ const Discord = require('discord.js');
|
|||||||
const ping = require('ping');
|
const ping = require('ping');
|
||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const Config = require('../config.js');
|
const Config = require('../config.js');
|
||||||
|
const CommandManager = require('../commandmanager.js');
|
||||||
const Helper = require('../helper.js');
|
const Helper = require('../helper.js');
|
||||||
|
|
||||||
/*message object, messaage full, message args, discord client*/
|
/*message object, messaage full, message args, discord client*/
|
||||||
|
|
||||||
|
module.exports.help = async function(message, msg, args, discordclient) {
|
||||||
|
var commands = CommandManager.commands;
|
||||||
|
if (args[1]) {
|
||||||
|
if (commands[args[1].toLowerCase()]) {
|
||||||
|
var em = new Discord.RichEmbed();
|
||||||
|
em.setColor('BLUE');
|
||||||
|
em.setTitle(commands[args[1]].name);
|
||||||
|
em.addField('Command:', commands[args[1]].command);
|
||||||
|
if (commands[args[1]].alt != undefined) {
|
||||||
|
em.addField('Alt:', commands[args[1]].alt)
|
||||||
|
}
|
||||||
|
em.addField('Usage:', '\`' + commands[args[1]].usage + '\`');
|
||||||
|
em.addField('Description:', commands[args[1]].desc);
|
||||||
|
|
||||||
|
//console.log(commands[args[1]]);
|
||||||
|
message.channel.send(em)
|
||||||
|
} else {
|
||||||
|
message.channel.send(`:no_entry_sign: \`That command does not exist\``);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
message.channel.send(`See a full command list at http://www.plane000.co.uk`); //temporary
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
module.exports.say = async function(message, msg, args, discordclient) {
|
module.exports.say = async function(message, msg, args, discordclient) {
|
||||||
message.channel.send(msg.slice(4, msg.length));
|
message.channel.send(msg.slice(4, msg.length));
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user