summon edits and hopefully bug fix

This commit is contained in:
Dalton
2018-12-06 22:39:29 -08:00
parent 689b409c89
commit ae65da1bf7
2 changed files with 380 additions and 365 deletions

View File

@@ -13,6 +13,7 @@ build:
deploy_staging: deploy_staging:
stage: deploy stage: deploy
script: script:
- echo "Deploy to staging server" - echo "Deploy to staging server"
environment: environment:

744
bot.js
View File

@@ -12,109 +12,157 @@ var channel = null;
// available commands // available commands
function availableCommands() { function availableCommands() {
return "Available commands: " + return "Available commands: " +
"\n**[SFW]** b.<*coinflip, 8ball, roll, compute, summon, bunny, dankmemes, meirl, animemes, moe, moe-boys, hotguys , kgirls, kboys*>" + "\n**[SFW]** b.<*coinflip, 8ball, roll, compute, summon, bunny, dankmemes, meirl, animemes, moe, moe-boys, hotguys , kgirls, kboys*>" +
"\n**[NSFW]** b.<*lewd, ecchi, hentai, yaoi, yuri, neko, pokeporn, hgifs*>" + "\n**[NSFW]** b.<*lewd, ecchi, hentai, yaoi, yuri, neko, pokeporn, hgifs*>" +
"\nFor more information on a command, you may use: *b.help <command>*"; "\nFor more information on a command, you may use: *b.help <command>*";
} }
// help commands // help commands
function commandsHelp(requestedCommand) { function commandsHelp(requestedCommand) {
var commands = {"coinflip": "**coinflip:** Returns a result of heads or tails.", var commands = {
"8ball": "**8ball:** Shakes an 8 ball and returns a result.", "coinflip": "**coinflip:** Returns a result of heads or tails.",
"roll": "**roll:** Rolls a number between 1-100 (or a specified range [ex: b.roll 50-100])", "8ball": "**8ball:** Shakes an 8 ball and returns a result.",
"compute": "**compute:** Uses WolframAlpha to process the question asked.", "roll": "**roll:** Rolls a number between 1-100 (or a specified range [ex: b.roll 50-100])",
"summon": "**summon:** Posts a picture from a user inputted subreddit", "compute": "**compute:** Uses WolframAlpha to process the question asked.",
"bunny": "**bunny:** Posts a picture of different bunnies", "summon": "**summon:** Posts a picture from a user inputted subreddit",
"dankmemes": "**dankmemes:** Posts a picture of some dank memes (r/dankmemes)", "bunny": "**bunny:** Posts a picture of different bunnies",
"meirl": "**meirl:** Posts a picture of anime irl (r/anime_irl)", "dankmemes": "**dankmemes:** Posts a picture of some dank memes (r/dankmemes)",
"animemes": "**animemes:** Posts a picture of anime memes (r/animemes)", "meirl": "**meirl:** Posts a picture of anime irl (r/anime_irl)",
"moe": "**moe:** Posts a picture of moe anime (r/awwnime)", "animemes": "**animemes:** Posts a picture of anime memes (r/animemes)",
"moe-boys": "**moe-boys:** Posts a picture of moe anime boys (r/cuteanimeboys)", "moe": "**moe:** Posts a picture of moe anime (r/awwnime)",
"hotguys": "**hotguys:** Posts a picture of hot anime guys (r/bishounen)", "moe-boys": "**moe-boys:** Posts a picture of moe anime boys (r/cuteanimeboys)",
"kgirls": "**kgirls:** Posts a picture of k-pop girls (r/kpics or r/kpopfap)", "hotguys": "**hotguys:** Posts a picture of hot anime guys (r/bishounen)",
"kboys": "**kboys:** Posts a picture of k-pop guys (r/kfanservice, r/kpecs, or r/cutekboys)", "kgirls": "**kgirls:** Posts a picture of k-pop girls (r/kpics or r/kpopfap)",
"lewd": "[NSFW] **lewd:** Posts a picture of lewd anime girls (r/pantsu)", "kboys": "**kboys:** Posts a picture of k-pop guys (r/kfanservice, r/kpecs, or r/cutekboys)",
"ecchi": "[NSFW] **ecchi:** Posts a picture of ecchi anime girls (r/ecchi)", "lewd": "[NSFW] **lewd:** Posts a picture of lewd anime girls (r/pantsu)",
"hentai": "[NSFW] **hentai:** Posts a picture of hentai (r/hentai or r/sukebei)", "ecchi": "[NSFW] **ecchi:** Posts a picture of ecchi anime girls (r/ecchi)",
"yaoi": "[NSFW] **yaoi:** Posts a picture of yaoi (r/yaoi)", "hentai": "[NSFW] **hentai:** Posts a picture of hentai (r/hentai or r/sukebei)",
"yuru": "[NSFW] **yuri:** Post a picture of yuri (r/yuri)", "yaoi": "[NSFW] **yaoi:** Posts a picture of yaoi (r/yaoi)",
"neko": "[NSFW] **neko:** Posts a picture of cat girls (r/nekomimi)", "yuru": "[NSFW] **yuri:** Post a picture of yuri (r/yuri)",
"pokeporn": "[NSFW] **pokeporn:** Posts a picture of pokemon hentai (r/pokeporn)", "neko": "[NSFW] **neko:** Posts a picture of cat girls (r/nekomimi)",
"hgifs": "[NSFW] **hgifs:** Posts a gif of hentai (r/nsfwanimegifs)", "pokeporn": "[NSFW] **pokeporn:** Posts a picture of pokemon hentai (r/pokeporn)",
"hentaibondage": "[NSFW] **hentaibondage:** Posts a picture of hentai in bondage (r/hentaibondage)"}; "hgifs": "[NSFW] **hgifs:** Posts a gif of hentai (r/nsfwanimegifs)",
"hentaibondage": "[NSFW] **hentaibondage:** Posts a picture of hentai in bondage (r/hentaibondage)"
};
if (commands[requestedCommand] === undefined) if (commands[requestedCommand] === undefined) {
{
return "Command not found, try entering **b.commands** for a full list of commands"; return "Command not found, try entering **b.commands** for a full list of commands";
} }
else else {
{
return commands[requestedCommand]; return commands[requestedCommand];
} }
} }
// coin flip // coin flip
function coinFlip() { function coinFlip() {
return (Math.floor(Math.random() * 2) === 0) ? 'heads' : 'tails'; return (Math.floor(Math.random() * 2) === 0) ? 'heads' : 'tails';
} }
// 8 ball // 8 ball
function eightBall() { function eightBall() {
var answers = [ var answers = [
'Maybe.', 'Certainly not.', 'I hope so.', 'Not in your wildest dreams.', 'Maybe.', 'Certainly not.', 'I hope so.', 'Not in your wildest dreams.',
'There is a good chance.', 'Quite likely.', 'I think so.', 'I hope not.', 'There is a good chance.', 'Quite likely.', 'I think so.', 'I hope not.',
'I hope so.', 'Never!', 'Fuhgeddaboudit.', 'Ahaha! Really?!?', 'Pfft.', 'I hope so.', 'Never!', 'Fuhgeddaboudit.', 'Ahaha! Really?!?', 'Pfft.',
'Sorry, bucko.', 'Hell, yes.', 'Hell to the no.', 'The future is bleak.', 'Sorry, bucko.', 'Hell, yes.', 'Hell to the no.', 'The future is bleak.',
'The future is uncertain.', 'I would rather not say.', 'Who cares?', 'The future is uncertain.', 'I would rather not say.', 'Who cares?',
'Possibly.', 'Never, ever, ever.', 'There is a small chance.', 'Yes!']; 'Possibly.', 'Never, ever, ever.', 'There is a small chance.', 'Yes!'];
return answers[(Math.floor(Math.random() * answers.length))]; return answers[(Math.floor(Math.random() * answers.length))];
} }
// number roll // number roll
function numberRoll(startingRange, endingRange) { function numberRoll(startingRange, endingRange) {
startingRange = Math.ceil(startingRange); startingRange = Math.ceil(startingRange);
endingRange = Math.floor(endingRange); endingRange = Math.floor(endingRange);
return Math.floor(Math.random() * (endingRange-startingRange)) + startingRange; return Math.floor(Math.random() * (endingRange - startingRange)) + startingRange;
} }
// stupid question response // stupid question response
function stupidQuestion() { function stupidQuestion() {
var answers = [ let answers = [
'What kind of dumb question is that?', 'A real question please.', 'What kind of dumb question is that?', 'A real question please.',
'Is that supposed to be a question?', 'Who asked such a dumb question?', 'Is that supposed to be a question?', 'Who asked such a dumb question?',
'How about a good question instead?', 'Only good questions please', 'How about a good question instead?', 'Only good questions please',
'Oh god, is that a question?', 'Are you dumb because that\'s a dumb question.']; 'Oh god, is that a question?', 'Are you dumb because that\'s a dumb question.'];
return answers[(Math.floor(Math.random() * answers.length))]; return answers[(Math.floor(Math.random() * answers.length))];
} }
function noQuestion() { function noQuestion() {
var answers = ['it helps to ask a question...', 'question plz.', 'where is the question?']; let answers = ['it helps to ask a question...', 'question plz.', 'where is the question?'];
return answers[(Math.floor(Math.random() * answers.length))]; return answers[(Math.floor(Math.random() * answers.length))];
} }
// Try's all sources and returns in preferred order
// 1. Reddit
// 2. Imgur
// 3. RedditBooru
function bestEffortRequest(subpage, page_max) {
let reddit_response = subredditRequest(subpage);
if(reddit_response) { return reddit_response; }
let imgur_response;
if(page_max) {
imgur_response = imgurRequest(subpage, page_max);
if(imgur_response) { return imgur_response }
}
let redditbooru_response = redditbooruRequest(subpage);
if(redditbooru_response) { return redditbooru_response }
return "I couldn't find that, sauce?";
}
// Dalton's image summon command.
// Checks for banned author's using a hard coded list of discord ids.
// Also rudely cleans garbage entries.
function summonCommand() {
let bannedAuthors = ['143999140878090240'];
if (bannedAuthors.contains(message.author)) {
let messageSplit = message.content.substring(2).split(' ');
if (messageSplit.length >= 2) {
let redditToSummon = messageSplit[1].replace(/[^a-zA-Z0-9_\-]+/g, "");
// Valid Argument
if (redditToSummon) {
message.channel.send(message.author + ' summons *' + redditToSummon + '*\n');
let site_response = bestEffortRequest(redditToSummon, 5);
if (site_response) {
message.channel.send(redditResponse);
}
// Missing Argument
} else {
message.reply("wut do i summon?");
}
}
} else {
message.reply("You're a bad boi and a banned author, you can't summon til you learn to behave.")
}
}
// imgur request // imgur request
function imgurRequest(subreddit, page_max) function imgurRequest(subreddit, page_max) {
{
var multiSubreddit = subreddit.split(','); var multiSubreddit = subreddit.split(',');
var request_url = 'https://api.imgur.com/3/gallery/r/' + multiSubreddit[getRandomInt(0, multiSubreddit.length-1)] + '/time/' + getRandomInt(1,page_max); var request_url = 'https://api.imgur.com/3/gallery/r/' + multiSubreddit[getRandomInt(0, multiSubreddit.length - 1)] + '/time/' + getRandomInt(1, page_max);
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
var returnText = ""; var returnText = "";
req.onreadystatechange = function() req.onreadystatechange = function () {
{ if (req.readyState === 4 && req.status === 200) {
if (req.readyState === 4 && req.status === 200) if (req.responseText !== "Not found") {
{
if(req.responseText != "Not found")
{
var json = JSON.parse(req.responseText); var json = JSON.parse(req.responseText);
returnText = json.data[getRandomInt(0,json.data.length-1)].link; returnText = json.data[getRandomInt(0, json.data.length - 1)].link;
} }
} }
}; };
req.open("GET", request_url, false); req.open("GET", request_url, false);
@@ -125,36 +173,30 @@ function imgurRequest(subreddit, page_max)
} }
// subreddit request // subreddit request
function subredditRequest(subreddit) function subredditRequest(subreddit) {
{
var multiSubreddit = subreddit.split(','); var multiSubreddit = subreddit.split(',');
var redditURL = "https://www.reddit.com/r/" + multiSubreddit[getRandomInt(0, multiSubreddit.length-1)] + "/.json?show=all&count=25&limit=100"; var redditURL = "https://www.reddit.com/r/" + multiSubreddit[getRandomInt(0, multiSubreddit.length - 1)] + "/.json?show=all&count=25&limit=100";
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
var returnText = ""; var returnText = "";
req.onreadystatechange = function() req.onreadystatechange = function () {
{ if (req.readyState === 4 && req.status === 200) {
if(req.readyState === 4 && req.status === 200)
{
var json = JSON.parse(req.responseText); var json = JSON.parse(req.responseText);
while(true) while (true) {
{ var i = getRandomInt(0, json.data.children.length - 1);
var i = getRandomInt(0,json.data.children.length-1); try {
try if (json.data.children[i].data.post_hint === "image" || json.data.children[i].data.post_hint === "link" || json.data.children.data.post_hint === "rich:video") {
{ returnText = json.data.children[i].data.url;
if(json.data.children[i].data.post_hint === "image" || json.data.children[i].data.post_hint === "link" || json.data.children.data.post_hint === "rich:video") break;
{ }
returnText = json.data.children[i].data.url; }
break; catch (error) // error parsing json
} {
} // Ignore the error and continue.
catch (error) // error parsing json // continue; <-- last line in the loop... so does nothing.
{ }
// Ignore the error and continue.
// continue; <-- last line in the loop... so does nothing.
}
} }
} }
}; };
@@ -166,23 +208,20 @@ function subredditRequest(subreddit)
} }
// redditbooru request // redditbooru request
function redditbooruRequest(subreddit) function redditbooruRequest(subreddit) {
{
var multiSubreddit = subreddit.split(','); var multiSubreddit = subreddit.split(',');
var url = "https://" + multiSubreddit[getRandomInt(0, multiSubreddit.length-1)] + ".redditbooru.com/images/?limit=1000"; var url = "https://" + multiSubreddit[getRandomInt(0, multiSubreddit.length - 1)] + ".redditbooru.com/images/?limit=1000";
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
var returnText = ""; var returnText = "";
req.onreadystatechange = function() req.onreadystatechange = function () {
{ if (req.readyState === 4 && req.status === 200) {
if(req.readyState === 4 && req.status === 200)
{
var json = JSON.parse(req.responseText); var json = JSON.parse(req.responseText);
var imageID = getRandomInt(0, json.length); var imageID = getRandomInt(0, json.length);
returnText = json[imageID].cdnUrl; returnText = json[imageID].cdnUrl;
} }
} };
req.open("GET", url, false); req.open("GET", url, false);
req.send(); req.send();
@@ -191,19 +230,16 @@ function redditbooruRequest(subreddit)
} }
// wolframalpha computation // wolframalpha computation
function calculate(message) function calculate(message) {
{
var url = "http://api.wolframalpha.com/v1/result?appid=" + auth.wolframalpha + "&i=" + encodeURIComponent(message); var url = "http://api.wolframalpha.com/v1/result?appid=" + auth.wolframalpha + "&i=" + encodeURIComponent(message);
var req = new XMLHttpRequest(); var req = new XMLHttpRequest();
var returnText = ""; var returnText = "";
req.onreadystatechange = function() req.onreadystatechange = function () {
{ if (req.readyState === 4 && req.status === 200) {
if(req.readyState === 4 && req.status === 200)
{
returnText = req.responseText; returnText = req.responseText;
} }
} };
req.open("GET", url, false); req.open("GET", url, false);
req.send(); req.send();
@@ -212,25 +248,20 @@ function calculate(message)
} }
// get random number with starting and ending number // get random number with starting and ending number
function getRandomInt(min, max) function getRandomInt(min, max) {
{
return Math.floor(Math.random() * (max - min + 1)) + min; return Math.floor(Math.random() * (max - min + 1)) + min;
} }
// voice setup // voice setup
function setupVoice(file, volume, voice_channel) function setupVoice(file, volume, voice_channel) {
{
playQueue.unshift(file); playQueue.unshift(file);
playVolume.unshift(volume); playVolume.unshift(volume);
if(!channel) if (!channel) {
{
channel = voice_channel; channel = voice_channel;
} }
if(channel instanceof Discord.VoiceChannel) if (channel instanceof Discord.VoiceChannel) {
{ if (!queueExists) {
if(!queueExists)
{
queueExists = true; queueExists = true;
channel.join().then(connection => channel.join().then(connection =>
{ {
@@ -238,8 +269,7 @@ function setupVoice(file, volume, voice_channel)
}); });
} }
} }
else else {
{
playQueue.pop(); playQueue.pop();
playVolume.pop(); playVolume.pop();
channel = null; channel = null;
@@ -247,10 +277,8 @@ function setupVoice(file, volume, voice_channel)
} }
// voice queue // voice queue
function handlePlayQueue(connection) function handlePlayQueue(connection) {
{ if (playQueue.length === 0) {
if (playQueue.length === 0)
{
return; return;
} }
@@ -259,22 +287,20 @@ function handlePlayQueue(connection)
dispatcher.on("end", () => dispatcher.on("end", () =>
{ {
playQueue.pop(); playQueue.pop();
playVolume.pop(); playVolume.pop();
if(playQueue.length === 0) if (playQueue.length === 0) {
{ queueExists = false;
queueExists = false; if (channel != null) {
if(channel != null) channel.leave();
{ channel = null;
channel.leave();
channel = null;
}
} }
else }
{ else {
handlePlayQueue(connection); handlePlayQueue(connection);
} }
}); })
;
dispatcher.setVolume(playVolume[0]); dispatcher.setVolume(playVolume[0]);
} }
@@ -284,266 +310,254 @@ const client = new Discord.Client();
client.on('ready', () => { client.on('ready', () => {
console.log('Bot is ready'); console.log('Bot is ready');
// update status // update status
var availableTypes = ['PLAYING', 'LISTENING', 'WATCHING']; var availableTypes = ['PLAYING', 'LISTENING', 'WATCHING'];
var setType = availableTypes[Math.floor(Math.random() * availableTypes.length)]; var setType = availableTypes[Math.floor(Math.random() * availableTypes.length)];
var setStatus; var setStatus;
switch(setType) switch (setType) {
{ case 'PLAYING':
case 'PLAYING': var availableStatus = ['with cute bunnies', 'with bunny toys', 'in bunny heaven', 'with my pet bunny', 'with all the bunnies'];
var availableStatus = ['with cute bunnies', 'with bunny toys', 'in bunny heaven', 'with my pet bunny', 'with all the bunnies']; setStatus = availableStatus[Math.floor(Math.random() * availableStatus.length)];
setStatus = availableStatus[Math.floor(Math.random() * availableStatus.length)]; break;
break; case 'LISTENING':
case 'LISTENING': var availableStatus = ['to cute bunnies', 'to adorable bunnies eating', 'to bunnies playing with toys', 'to bunnies pouting'];
var availableStatus = ['to cute bunnies', 'to adorable bunnies eating', 'to bunnies playing with toys', 'to bunnies pouting']; setStatus = availableStatus[Math.floor(Math.random() * availableStatus.length)];
setStatus = availableStatus[Math.floor(Math.random() * availableStatus.length)]; break;
break; case 'WATCHING':
case 'WATCHING': var availableStatus = ['cute bunnies', 'cute bunnies play', 'cute bunnies sleep', 'bunnies nibbling on food', 'swiftimustv'];
var availableStatus = ['cute bunnies', 'cute bunnies play', 'cute bunnies sleep', 'bunnies nibbling on food', 'swiftimustv']; setStatus = availableStatus[Math.floor(Math.random() * availableStatus.length)];
setStatus = availableStatus[Math.floor(Math.random() * availableStatus.length)]; break;
break; }
}
client.user.setActivity(setStatus, {type: setType}); client.user.setActivity(setStatus, {type: setType});
}); })
;
// commands // commands
client.on('message', message => { client.on('message', message => {
if (message.content.substring(0, 2).toUpperCase() === 'B.') { if(message.content.substring(0, 2).toUpperCase() === 'B.') {
var args = message.content.substring(2).split(' '); var args = message.content.substring(2).split(' ');
var cmd = args[0]; var cmd = args[0];
switch(cmd) switch (cmd) {
{ // Reply commands
// Reply commands case 'command':
case 'command': case 'commands':
case 'commands': case 'help':
case 'help': var message_content = message.content.substring(2).split(' ');
var message_content = message.content.substring(2).split(' '); if (message.content.substring(2).split(' ')[1] === undefined) {
if(message.content.substring(2).split(' ')[1] === undefined) message.channel.send(availableCommands());
{ }
message.channel.send(availableCommands()); else {
} message.channel.send(commandsHelp(message_content[1]));
else }
{ break;
message.channel.send(commandsHelp(message_content[1])); case 'coinflip':
} case 'coin':
break; message.channel.send(message.author + ' flipped a coin, it landed on **' + coinFlip() + '!**');
case 'coinflip': break;
case 'coin': case '8ball':
message.channel.send(message.author + ' flipped a coin, it landed on **' + coinFlip() + '!**'); if (message.content.substring(8).length > 0) {
break; message.channel.send(message.author + ' asked: *' + message.content.substring(8) + '*\n' +
case '8ball': 'The magic 8 ball says: **' + eightBall() + '**');
if(message.content.substring(8).length > 0) }
{ else {
message.channel.send(message.author + ' asked: *' + message.content.substring(8) + '*\n' + message.reply(noQuestion());
'The magic 8 ball says: **' + eightBall() + '**'); }
} break;
else case 'roll':
{ var message_content = message.content.substring(2).split(' ');
message.reply(noQuestion()); if (message_content[1] !== undefined && message_content[1].length > 0) // ranged roll
} {
break; var regex = /^[0-9]+-[0-9]+$/;
case 'roll': if (regex.test(message_content[1])) {
var message_content = message.content.substring(2).split(' '); var range_break = message_content[1].split('-');
if(message_content[1] !== undefined && message_content[1].length > 0) // ranged roll
{
var regex = /^[0-9]+-[0-9]+$/;
if(regex.test(message_content[1]))
{
var range_break = message_content[1].split('-');
message.channel.send(message.author + ' rolls a number between ' + range_break[0] + ' and ' + range_break[1] + '. They roll **' + numberRoll(range_break[0], range_break[1]) + '**.'); message.channel.send(message.author + ' rolls a number between ' + range_break[0] + ' and ' + range_break[1] + '. They roll **' + numberRoll(range_break[0], range_break[1]) + '**.');
}
else
{
message.channel.send('Unknown roll format. Use "**b.help roll**" for more information.');
}
} }
else // default roll (1-100) else {
{ message.channel.send('Unknown roll format. Use "**b.help roll**" for more information.');
message.channel.send(message.author + ' rolls a number between 1 and 100. They roll **' + numberRoll(1, 100) + '**.');
} }
break; }
case 'compute': else // default roll (1-100)
case 'convert': {
case 'calculate': message.channel.send(message.author + ' rolls a number between 1 and 100. They roll **' + numberRoll(1, 100) + '**.');
var message_content = message.content.substring(2).split(' '); }
if(message_content[1] !== undefined && message_content[1].length > 0) break;
{ case 'compute':
var response = calculate(message.content.substring(message.content.indexOf(' ')+1)); case 'convert':
if(response === "") case 'calculate':
{ var message_content = message.content.substring(2).split(' ');
response = stupidQuestion(); if (message_content[1] !== undefined && message_content[1].length > 0) {
} var response = calculate(message.content.substring(message.content.indexOf(' ') + 1));
message.channel.send(message.author + ' wants to compute: *' + message.content.substring(message.content.indexOf(' ')+1) + '*\n' + if (response === "") {
response = stupidQuestion();
}
message.channel.send(message.author + ' wants to compute: *' + message.content.substring(message.content.indexOf(' ') + 1) + '*\n' +
'The result is: **' + response + '**') 'The result is: **' + response + '**')
} }
else else {
{ message.reply(noQuestion());
message.reply(noQuestion()); }
} break;
break;
// SFW Generic Image commands // SFW Generic Image commands
case 'bun': case 'bun':
case 'bunny': case 'bunny':
case 'bunnies': case 'bunnies':
message.channel.send(imgurRequest('rabbits',5)); message.channel.send(imgurRequest('rabbits', 5));
break; break;
case 'dankmeme': case 'dankmeme':
case 'dankmemes': case 'dankmemes':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('dankmemes') : imgurRequest('dankmemes', 5)); message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('dankmemes') : imgurRequest('dankmemes', 5));
break; break;
case 'source': case 'source':
message.channel.send("BunnyBot's source code: https://git.dtam.pw/daniel/discord-bot-js"); message.channel.send("BunnyBot's source code: https://git.dtam.pw/daniel/discord-bot-js");
break; break;
case 'testcommand': case 'testcommand':
message.channel.send("testing! 3.0"); message.channel.send("testing! 3.0");
break; break;
// SFW Anime Image commands // SFW Anime Image commands
case 'meirl': case 'meirl':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('anime_irl') : imgurRequest('anime_irl', 5)); message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('anime_irl') : imgurRequest('anime_irl', 5));
break; break;
case 'animemes': case 'animemes':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('animemes') : imgurRequest('animemes', 5)); message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('animemes') : imgurRequest('animemes', 5));
break; break;
case 'moe': case 'moe':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? redditbooruRequest('awwnime') : imgurRequest('awwnime', 5)); message.channel.send((Math.floor(Math.random() * 2) === 0) ? redditbooruRequest('awwnime') : imgurRequest('awwnime', 5));
break; break;
case 'moe-boys': case 'moe-boys':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('cuteanimeboys') : imgurRequest('cuteanimeboys', 1)); message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('cuteanimeboys') : imgurRequest('cuteanimeboys', 1));
break; break;
case 'hotguys': case 'hotguys':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? redditbooruRequest('bishounen') : subredditRequest('bishounen')); message.channel.send((Math.floor(Math.random() * 2) === 0) ? redditbooruRequest('bishounen') : subredditRequest('bishounen'));
break; break;
case 'kgirls': case 'kgirls':
switch(Math.floor(Math.random() * 3)) switch (Math.floor(Math.random() * 3)) {
{ case 0:
case 0: message.channel.send(redditbooruRequest('kpics'));
message.channel.send(redditbooruRequest('kpics')); break;
break; case 1:
case 1: message.channel.send(imgurRequest('kpics', 5));
message.channel.send(imgurRequest('kpics', 5)); break;
break; case 2:
case 2: message.channel.send(subredditRequest('kpopfap'));
message.channel.send(subredditRequest('kpopfap')); break;
break; }
} break;
break; case 'kboys':
case 'kboys': switch (Math.floor(Math.random() * 3)) {
switch(Math.floor(Math.random() * 3)) case 0:
{ message.channel.send(imgurRequest('kfanservice', 1));
case 0: break;
message.channel.send(imgurRequest('kfanservice',1)); case 1:
break; message.channel.send(imgurRequest('kpecs', 1));
case 1: break;
message.channel.send(imgurRequest('kpecs',1)); case 2:
break; message.channel.send(imgurRequest('cutekboys', 1));
case 2: break;
message.channel.send(imgurRequest('cutekboys', 1)); }
break; break;
}
break;
// NSFW // NSFW
case 'lewd': case 'lewd':
message.channel.send(redditbooruRequest('pantsu')); message.channel.send(redditbooruRequest('pantsu'));
break; break;
case 'ecchi': case 'ecchi':
switch(Math.floor(Math.random() * 4)) switch (Math.floor(Math.random() * 4)) {
{ case 0:
case 0: message.channel.send(subredditRequest('ecchi'));
message.channel.send(subredditRequest('ecchi')); break;
break; case 1:
case 1: message.channel.send(redditbooruRequest('ecchi'));
message.channel.send(redditbooruRequest('ecchi')); break;
break; case 2:
case 2: message.channel.send(redditbooruRequest('Sukebei'));
message.channel.send(redditbooruRequest('Sukebei')); break;
break; case 3:
case 3: message.channel.send(imgurRequest('ecchi', 5));
message.channel.send(imgurRequest('ecchi', 5)); break;
break; }
} break;
break; case 'hentai':
case 'hentai': switch (Math.floor(Math.random() * 3)) {
message.channel.send((Math.floor(Math.random() * 2) === 0) ? imgurRequest('hentai', 5) : subredditRequest('hentai', 5)); case 0:
break; message.channel.send(subredditRequest('hentai', 5));
case 'yaoi': break;
message.channel.send(imgurRequest('yaoi', 5)); case 1:
break; message.channel.send(subredditRequest('hentaisource', 5));
case 'yuri': break;
message.channel.send(imgurRequest('yuri', 5)); case 2:
break; message.channel.send(imgurRequest('hentai', 5));
case 'neko': break;
message.channel.send((Math.floor(Math.random() * 2) === 0) ? imgurRequest('Nekomimi', 5) : subredditRequest('Nekomimi', 5)); }
break; break;
case 'pokeporn': case 'yaoi':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('pokeporn') : redditbooruRequest('pokeporn')); message.channel.send(imgurRequest('yaoi', 5));
break; break;
case 'hgifs': case 'yuri':
message.channel.send(subredditRequest('nsfwanimegifs', 5)); message.channel.send(imgurRequest('yuri', 5));
break; break;
case 'hentaibondage': case 'neko':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('hentaibondage') : imgurRequest('hentaibondage', 5)); message.channel.send((Math.floor(Math.random() * 2) === 0) ? imgurRequest('Nekomimi', 5) : subredditRequest('Nekomimi', 5));
break; break;
case 'pokeporn':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('pokeporn') : redditbooruRequest('pokeporn'));
break;
case 'hgifs':
message.channel.send(subredditRequest('nsfwanimegifs', 5));
break;
case 'hentaibondage':
message.channel.send((Math.floor(Math.random() * 2) === 0) ? subredditRequest('hentaibondage') : imgurRequest('hentaibondage', 5));
break;
case 'summon': case 'summon':
var redditToSummon = message.content.substring(2).split(' ')[1]; summonCommand();
if(redditToSummon) { break;
message.channel.send(message.author + ' summons *' + redditToSummon + '*\n'); // Voice commands
message.channel.send(subredditRequest(redditToSummon)) case 'join':
channel = message.member.voiceChannel;
} else { channel.join();
break;
message.reply("wut do i summon?"); case 'leave':
} case 'stop':
break; case 'skip':
if (channel != null) {
// Voice commands channel.leave();
case 'join': channel = null;
channel = message.member.voiceChannel; }
channel.join(); playQueue = [];
break; break;
case 'leave': case 'airhorn':
case 'stop': setupVoice('voice/mlg-airhorn.mp3', 0.4, message.member.voiceChannel);
case 'skip': break;
if(channel != null) case 'quiethorn':
{ setupVoice('voice/mlg-airhorn.mp3', 0.03, message.member.voiceChannel);
channel.leave(); break;
channel = null; case 'weed':
} setupVoice('voice/smoke-weed.mp3', 0.2, message.member.voiceChannel);
playQueue = []; break;
break; case 'damnson':
case 'airhorn': setupVoice('voice/damnson.mp3', 0.35, message.member.voiceChannel);
setupVoice('voice/mlg-airhorn.mp3', 0.4, message.member.voiceChannel); break;
break; case 'wombo':
case 'quiethorn': setupVoice('voice/wombocombo.mp3', 0.06, message.member.voiceChannel);
setupVoice('voice/mlg-airhorn.mp3', 0.03, message.member.voiceChannel); break;
break; case 'cena':
case 'weed': setupVoice('voice/cena.mp3', 0.10, message.member.voiceChannel);
setupVoice('voice/smoke-weed.mp3', 0.2, message.member.voiceChannel); break;
break; case 'triple':
case 'damnson': setupVoice('voice/triple.mp3', 0.20, message.member.voiceChannel);
setupVoice('voice/damnson.mp3', 0.35, message.member.voiceChannel); break;
break;
case 'wombo':
setupVoice('voice/wombocombo.mp3', 0.06, message.member.voiceChannel);
break;
case 'cena':
setupVoice('voice/cena.mp3', 0.10, message.member.voiceChannel);
break;
case 'triple':
setupVoice('voice/triple.mp3', 0.20, message.member.voiceChannel);
break;
}
} }
}); }
})
;
// login // login
client.login(auth.token); client.login(auth.token);