mirror of
https://github.com/jcreek/MupBot.git
synced 2026-07-13 02:43:45 +00:00
feat(*): Add arguments to help command
This commit is contained in:
+19
-4
@@ -17,18 +17,33 @@ module.exports = {
|
|||||||
};
|
};
|
||||||
|
|
||||||
function commandHelp (Discord, config, logger, message, command, args) {
|
function commandHelp (Discord, config, logger, message, command, args) {
|
||||||
const msg = `
|
const helpMessage = `
|
||||||
The commands available to you are:
|
The commands available to you are:
|
||||||
- \`${config.prefix}ud <query>\` - Search Urban Dictionary
|
\`${config.prefix}ud <query>\` - Search Urban Dictionary
|
||||||
|
\`${config.prefix}help <command>\` - For help with a specific command add the command as an argument
|
||||||
`;
|
`;
|
||||||
|
|
||||||
message.channel.send(msg);
|
// Specify specific command help
|
||||||
|
if (args.length > 0) {
|
||||||
|
switch (args[0]) {
|
||||||
|
case 'ud':
|
||||||
|
message.channel.send(`Usage: \`${config.prefix}ud <query>\` *Example: ${config.prefix}ud yeet*`);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
message.channel.send(`That command is not one I know yet - but you could add it! To find out more visit ${config.github_url}`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
message.channel.send(helpMessage);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function commandUrbanDictionary(Discord, config, logger, message, command, args) {
|
function commandUrbanDictionary(Discord, config, logger, message, command, args) {
|
||||||
if (!args.length) {
|
if (!args.length) {
|
||||||
//If the command is used incorrectly without arguments
|
//If the command is used incorrectly without arguments
|
||||||
return message.channel.send(`You didn't provide any arguments, ${message.author}!`);
|
return message.channel.send(`You didn't provide any arguments, ${message.author}!\nCorrect Usage: \`${config.prefix}ud <query>\``);
|
||||||
}
|
}
|
||||||
else if (args[0] != "") {
|
else if (args[0] != "") {
|
||||||
var searchQuery = args[0];
|
var searchQuery = args[0];
|
||||||
|
|||||||
Reference in New Issue
Block a user