Added help commands and descriptions
This commit is contained in:
56
bot.js
56
bot.js
@@ -9,6 +9,46 @@ var playVolume = [];
|
||||
var queueExists = false;
|
||||
var channel = null;
|
||||
|
||||
// available commands
|
||||
function availableCommands() {
|
||||
var commands = "Available commands: " +
|
||||
"\n**[SFW]** b.<*coinflip, 8ball, compute, bunny, dankmemes, meirl, moe, moe-boys, hotguys , kgirls, kboys*>" +
|
||||
"\n**[NSFW]** b.<*lewd, ecchi, hentai, yaoi, yuri, neko, hgifs*>" +
|
||||
"\nFor more information on a command, you may use: *b.help <command>*";
|
||||
|
||||
return commands;
|
||||
}
|
||||
|
||||
// help commands
|
||||
function commandsHelp(requestedCommand) {
|
||||
var commands = {"coinflip": "**coinflip:** Returns a result of heads or tails.",
|
||||
"8ball": "**8ball:** Shakes an 8 ball and returns a result.",
|
||||
"compute": "**compute:** Uses WolframAlpha to process the question asked.",
|
||||
"bunny": "**bunny:** Posts a picture from imgur on r/rabbits",
|
||||
"dankmemes": "**dankmemes:** Posts a picture from reddit/imgur on r/dankmemes",
|
||||
"meirl": "**meirl:** Posts a picture from reddit/imgur on r/anime_irl",
|
||||
"moe": "**moe:** Posts a picture from redditbooru/imgur on r/awwnime",
|
||||
"moe-boys": "**moe-boys:** Posts a picture from reddit/imgur on r/cuteanimeboys",
|
||||
"hotguys": "**hotguys:** Posts a picture from redditbooru/reddit on r/bishounen",
|
||||
"kgirls": "**kgirls:** Posts a picture from redditbooru/imgur on r/kpics or reddit on r/kpopfap",
|
||||
"kboys": "**kboys:** Posts a picture from imgur on r/kfanservice, r/kpecs, or r/cutekboys",
|
||||
"lewd": "[NSFW] **lewd:** Posts a picture from redditbooru on r/pantsu",
|
||||
"ecchi": "[NSFW] **ecchi:** Posts a picture from reddit/imgur on r/ecchi",
|
||||
"hentai": "[NSFW] **hentai:** Posts a picture from reddit/imgur on r/hentai or imgur on r/sukebei",
|
||||
"yaoi": "[NSFW] **yaoi:** Posts a picture from imgur on r/yaoi",
|
||||
"yuru": "[NSFW] **yuri:** Post a picture from imgur on r/yuri",
|
||||
"neko": "[NSFW] **neko:** Posts a picture from reddit/imgur on r/nekomimi",
|
||||
"hgifs": "[NSFW] **hgifs:** Posts a gif from reddit on r/nsfwanimegifs"};
|
||||
if (commands[requestedCommand] === undefined)
|
||||
{
|
||||
return "Command not found, try entering **b.commands** for a full list of commands";
|
||||
}
|
||||
else
|
||||
{
|
||||
return commands[requestedCommand];
|
||||
}
|
||||
}
|
||||
|
||||
// coin flip
|
||||
function coinFlip() {
|
||||
return (Math.floor(Math.random() * 2) == 0) ? 'heads' : 'tails';
|
||||
@@ -242,10 +282,20 @@ client.on('message', message => {
|
||||
switch(cmd)
|
||||
{
|
||||
// Reply commands
|
||||
case 'command':
|
||||
case 'commands':
|
||||
message.channel.send('Available commands: ' +
|
||||
'\n**[SFW]** b.<*coinflip, 8ball, compute, bunny, dankmemes, meirl, moe, moe-boys, hotguys , kgirls, kboys*>' +
|
||||
'\n**[NSFW]** b.<*lewd, ecchi, hentai, yaoi, yuri, neko, hgifs*>');
|
||||
message.channel.send(availableCommands());
|
||||
break;
|
||||
case 'help':
|
||||
var message_content = message.content.substring(2).split(' ');
|
||||
if(message_content[1] === undefined)
|
||||
{
|
||||
message.channel.send(availableCommands());
|
||||
}
|
||||
else
|
||||
{
|
||||
message.channel.send(commandsHelp(message_content[1]));
|
||||
}
|
||||
break;
|
||||
case 'coinflip':
|
||||
case 'coin':
|
||||
|
Reference in New Issue
Block a user