Update time woo

This commit is contained in:
Emily 2020-03-26 15:31:32 +11:00
parent 0fc9659b9c
commit 3ec4d08763
45 changed files with 1139 additions and 279 deletions

View file

@ -15,3 +15,25 @@ added sexuality command, has definitions of sexualities
renamed math calculate renamed math calculate
fixed woomy in dms fixed woomy in dms
roleinfo now displays what permissions a role has and also the role colour in the thumbnail roleinfo now displays what permissions a role has and also the role colour in the thumbnail
request has been replaced with node-fetch
added neko
added fact
added nekogif
added dog
added cat
added hug
added kiss
added pat
added poke
added slap
added tickle
added cuddle
added feed
added smug
added lizard
added kemonomimi
added spoilerise
added zalgo
renamed flip coinflip
small changes to weather
recategorised some commands

View file

@ -1,84 +1,55 @@
if (Number(process.version.slice(1).split(".")[0]) < 12) {
throw new Error("Node 12.0.0 or higher is required. Please update Node on your system.");
};
const Discord = require('discord.js'); const Discord = require('discord.js');
const { promisify } = require('util'); const { promisify } = require('util');
const readdir = promisify(require('fs').readdir); const readdir = promisify(require('fs').readdir);
const Enmap = require('enmap'); const Enmap = require('enmap');
const chalk = require('chalk'); const chalk = require('chalk');
const DBL = require("dblapi.js");
const client = new Discord.Client(); const client = new Discord.Client();
try { try {
client.config = require('./config'); client.config = require('./config');
} catch (err) { } catch (err) {
console.log('Could not load config.js: \n', err); console.log('Failed to load config.js:', err);
process.exit(); process.exit();
} };
try{ try{
client.version = require('./version.json'); client.version = require('./version.json');
} catch (err) { } catch (err) {
console.log('Could not load version.json: \n', err); console.log('Failed to load version.json:', err);
process.exit(); process.exit();
} };
try{ try{
client.logger = require('./src/modules/Logger'); client.logger = require('./src/modules/Logger');
} catch (err) { } catch (err) {
console.log('Could not load Logger.js: \n', err); console.log('Failed to load Logger.js:', err);
process.exit(); process.exit();
} };
client.logger.setClient(client);
try{ try{
require("./src/modules/functions")(client); require("./src/modules/functions")(client);
} catch (err) { } catch (err) {
console.log('Could not load functions.js: \n', err); console.log('Failed to load functions.js:', err);
process.exit(); process.exit();
} };
try{
client.logger.setClient(client);
} catch (err) {
console.log('Logger failed to initialize: \n', err);
process.exit(1);
}
if(process.env['USER'] != 'container') { if(process.env['USER'] != 'container') {
client.devmode = true; client.devmode = true;
} else { } else {
client.devmode = false; client.devmode = false;
if(client.config.dblkey.length == 0) { if(client.config.dblkey.length > 0) {
const DBL = require("dblapi.js");
const dblapi = new DBL(client.config.dblkey, client); const dblapi = new DBL(client.config.dblkey, client);
} };
} };
try{
client.commands = new Enmap(); client.commands = new Enmap();
} catch (err) {
console.log('Failed to create the commands database: \n', err);
process.exit();
}
try{
client.aliases = new Enmap(); client.aliases = new Enmap();
} catch (err) {
console.log('Failed to create the aliases database: \n', err);
process.exit();
}
try{
client.settings = new Enmap({name: 'settings'}); client.settings = new Enmap({name: 'settings'});
} catch (err) {
console.log('Failed to initialize the settings database: \n', err);
process.exit();
}
try{
client.blacklist = new Enmap({name: 'blacklist'});
} catch (err) {
console.log('Failed to initialize the blacklist database: \n', err);
process.exit(1);
}
try{
const init = async () => { const init = async () => {
const cmdFiles = await readdir("./src/commands/"); const cmdFiles = await readdir("./src/commands/");
client.logger.info(`Loading ${cmdFiles.length} commands.`); client.logger.info(`Loading ${cmdFiles.length} commands.`);
@ -103,30 +74,17 @@ const init = async () => {
client.on(eventName, event.bind(null, client)); client.on(eventName, event.bind(null, client));
}); });
try{
client.levelCache = {}; client.levelCache = {};
for (let i = 0; i < client.config.permLevels.length; i++) { for (let i = 0; i < client.config.permLevels.length; i++) {
const thisLevel = client.config.permLevels[i]; const thisLevel = client.config.permLevels[i];
client.levelCache[thisLevel.name] = thisLevel.level; client.levelCache[thisLevel.name] = thisLevel.level;
}; };
} catch (err) {
console.log('Level cache failed to initialize: \n', err);
process.exit();
}
try{
if(client.devmode === true) { if(client.devmode === true) {
client.login(client.config.devtoken); client.login(client.config.devtoken);
} else { } else {
client.login(client.config.token); client.login(client.config.token);
}; };
} catch (err) {
console.log('Could not login to Discord: \n', err);
process.exit(1);
}
}; };
init(); init();
} catch (err) {
console.log('Initialization failed: \n', err);
process.exit(1);
}

View file

@ -5,7 +5,7 @@
"main": "index.js", "main": "index.js",
"dependencies": { "dependencies": {
"@discordjs/opus": "^0.1.0", "@discordjs/opus": "^0.1.0",
"better-sqlite3": "^5.4.1", "better-sqlite3": "^5.4.3",
"chalk": "^3.0.0", "chalk": "^3.0.0",
"dblapi.js": "^2.3.1", "dblapi.js": "^2.3.1",
"discord.js": "^12.0.2", "discord.js": "^12.0.2",
@ -13,16 +13,17 @@
"garfield": "^1.1.2", "garfield": "^1.1.2",
"get-youtube-id": "^1.0.1", "get-youtube-id": "^1.0.1",
"hastebin-gen": "^2.0.5", "hastebin-gen": "^2.0.5",
"is-url": "^1.2.4",
"moment": "^2.24.0", "moment": "^2.24.0",
"moment-duration-format": "^2.3.2", "moment-duration-format": "^2.3.2",
"nekos.life": "^2.0.5",
"node-fetch": "^2.6.0",
"openweather-apis": "^4.2.0",
"prism-media": "^1.2.1", "prism-media": "^1.2.1",
"randomcolor": "^0.5.4", "randomcolor": "^0.5.4",
"relevant-urban": "^2.0.0", "relevant-urban": "^2.0.0",
"request": "^2.88.2", "request": "^2.88.2",
"to-zalgo": "^1.0.1",
"urban": "^0.3.2", "urban": "^0.3.2",
"url-unshort": "^5.0.0",
"url-unshorten": "^1.0.6",
"weather-js": "^2.0.0", "weather-js": "^2.0.0",
"youtube-info": "^1.3.2", "youtube-info": "^1.3.2",
"ytdl-core-discord": "^1.1.0" "ytdl-core-discord": "^1.1.0"

View file

@ -26,9 +26,9 @@ exports.run = (client, message) => {
} }
embed = new Discord.MessageEmbed(); embed = new Discord.MessageEmbed();
embed.setTitle(`Woomy`);
embed.setColor(client.embedColour(message)); embed.setColor(client.embedColour(message));
embed.setThumbnail(client.user.avatarURL({format: "png", dynamic: true, size: 2048})) embed.setThumbnail(client.user.avatarURL({format: "png", dynamic: true, size: 2048}))
embed.setTitle("About Woomy")
embed.addField( embed.addField(
"General:", `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${duration}\``,true "General:", `• users: \`${client.users.cache.size}\`\n• channels: \`${client.channels.cache.size}\`\n• servers: \`${client.guilds.cache.size}\`\n• commands: \`${client.commands.size}\`\n• uptime: \`${duration}\``,true
); );

30
src/commands/cat.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.meow().then((json) => {
message.channel.send(json.url)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("cat.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "cat",
category: "Image",
description: "Sends you cat pics.",
usage: "cat"
};

View file

@ -1,14 +1,12 @@
const request = require("request"); const fetch = require("node-fetch")
exports.run = async (bot, message, args) => { exports.run = async (bot, message, args) => {
message.channel.startTyping(); message.channel.startTyping();
try{ try{
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => { fetch('https://catfact.ninja/facts')
message.channel.send(`**Did you know?**\n ${body.data[0].fact}`); .then(res => res.json())
message.channel.stopTyping(); .then(json => message.channel.send(`__**Did you know?**__\n${json.data[0].fact}`))
});
} catch(err) { } catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`); message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping(); message.channel.stopTyping();
}; };
}; };

View file

@ -22,14 +22,14 @@ exports.run = (client, message, args) => {
exports.conf = { exports.conf = {
enabled: true, enabled: true,
guildOnly: false, guildOnly: false,
aliases: [], aliases: ["flip"],
permLevel: "User", permLevel: "User",
requiredPerms: [] requiredPerms: []
}; };
exports.help = { exports.help = {
name: "flip", name: "coinflip",
category: "Fun", category: "Fun",
description: "Flips a coin!", description: "Flips a coin!",
usage: "flip [heads/tails]" usage: "coinflip [heads/tails]"
}; };

View file

@ -1,6 +1,6 @@
exports.run = async (client, message, args) => { exports.run = async (client, message, args) => {
message.channel.send( message.channel.send(
`**Credits:**\n\`mudkipscience#8904\` and \`FLGX#9896\`for developing the bot\n\`An Idiots Guide\` for the Guidebot bot base\n\`dellannie#6057\` for helping with the music commands\n\`TheCakeChicken#9088\` and \`Tina the Cyclops girl#0064\` for helping me not suck at coding\n\`AirVentTrent\` for the icon, find him on Instagram` `__**Credits:**__\n\`mudkipscience#8904\`, \`FLGX#9896\` and \`TheCakeChicken#9088\` for developing the bot\n\`An Idiots Guide\` for the Guidebot bot base\n\`Tina the Cyclops girl#0064\` for helping me not suck at coding\n\`AirVentTrent\` for the icon, find him on Instagram\n\`Terryiscool160\` for contributing to Woomy.`
); );
}; };
@ -14,7 +14,7 @@ exports.conf = {
exports.help = { exports.help = {
name: "credits", name: "credits",
category: "Miscellaneous", category: "Utility",
description: "Cool people", description: "Cool people",
usage: "credits" usage: "credits"
}; };

45
src/commands/creeper.js Normal file
View file

@ -0,0 +1,45 @@
const lyric = require('../../resources/other/lyrics.json')
exports.run = async (client, message, args, level) => {
var lyrics = lyric.creeper;
var runtop = true;
var runbottom = false;
for(var br = 0; br < lyrics.length; br++) {
{
if (runtop === true) {
var response = await client.awaitReply(message, lyrics[br]);
runbottom = false;
};
if (runbottom === true) {
if (response !== lyrics[br]) {
return message.channel.send("Those aren't the lyrics!")
}
runtop = false
};
} if (runtop === true) {
runtop = false
runbottom = true
} else if (runbottom === true) {
runtop = true
runbottom = false
}
}
message.channel.send("What a lovely duet!")
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "creeper",
category: "Fun",
description: "Aww man",
usage: "creeper"
};

69
src/commands/cuddle.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to cuddle! Usage: \`${client.commands.get(`cuddle`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.cuddle().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** cuddled **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("cuddle.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "cuddle",
category: "Action",
description: "cuddle someone!",
usage: "cuddle [@user/user] (you can cuddle as many people as you want!)"
};

View file

@ -1,45 +1,27 @@
exports.run = async (bot, message, args) => {
const lyric = require('../../resources/other/lyrics.json') if (args.length === 0) {
exports.run = async (client, message, args, level) => { message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`);
var lyrics = lyric.creeper; } else {
if (args[0].match(/^\d+$/)) {
var runtop = true; message.channel.send(`🎲 You rolled a ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}!`);
var runbottom = false; } else {
for(var br = 0; br < lyrics.length; br++) { message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`);
{
if (runtop === true) {
var response = await client.awaitReply(message, lyrics[br]);
runbottom = false;
};
if (runbottom === true) {
if (response !== lyrics[br]) {
return message.channel.send("Those aren't the lyrics!")
}
runtop = false
};
} if (runtop === true) {
runtop = false
runbottom = true
} else if (runbottom === true) {
runtop = true
runbottom = false
} }
} }
message.channel.send("What a lovely duet!")
}; };
exports.conf = { exports.conf = {
enabled: true, enabled: true,
guildOnly: false, guildOnly: false,
aliases: [], aliases: ["diceroll", "roll"],
permLevel: "User", permLevel: "User",
requiredPerms: [] requiredPerms: []
}; };
exports.help = { exports.help = {
name: "creeper", name: "dice",
category: "Fun", category: "Fun",
description: "Aww man", description: "Rolls a dice.",
usage: "creeper" usage: "dice <faces>"
}; };

View file

@ -1,27 +0,0 @@
exports.run = async (bot, message, args) => {
if (args.length === 0) {
message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`);
} else {
if (args[0].match(/^\d+$/)) {
message.channel.send(`🎲 You rolled a ${Array.from(Array(parseInt(args[0])).keys()).random() + 1}!`);
} else {
message.channel.send(`🎲 You rolled a ${Array.from(Array(6).keys()).random() + 1}!`);
}
}
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["diceroll"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "dice",
category: "Fun",
description: "Rolls a dice.",
usage: "dice **OR** dice <number>"
};

30
src/commands/dog.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.woof().then((json) => {
message.channel.send(json.url)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("dog.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "dog",
category: "Image",
description: "Sends you dog pics.",
usage: "dog"
};

View file

@ -1,14 +1,13 @@
const request = require("request"); const fetch = require("node-fetch");
exports.run = async (bot, message, args) => { exports.run = async (bot, message, args) => {
message.channel.startTyping(); message.channel.startTyping();
try{ try{
request({ uri: "https://dog-api.kinduff.com/api/facts", json: true }, (error, response, body) => { fetch('https://dog-api.kinduff.com/api/facts')
message.channel.send(`**Did you know?**\n ${body.facts[0]}`); .then(res => res.json())
.then(json => message.channel.send(`__**Did you know?**__\n ${json.facts[0]}`));
message.channel.stopTyping(); message.channel.stopTyping();
});
} catch(err) { } catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`); message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping(); message.channel.stopTyping();
}; };
}; };

View file

@ -34,7 +34,7 @@ exports.run = (client, message, args) => {
if(emojified.length > 2000) { if(emojified.length > 2000) {
return message.channel.send("<:error:466995152976871434> The emojified message exceeds 2000 characters.") return message.channel.send("<:error:466995152976871434> The emojified message exceeds 2000 characters.")
} };
message.channel.send(emojified); message.channel.send(emojified);
}; };

30
src/commands/fact.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.fact().then((json) => {
message.channel.send("__**Did you know?**__\n" + json.fact + ".");
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("fact.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["randomfact"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "fact",
category: "Fun",
description: "Sends you a random fact.",
usage: "fact"
};

69
src/commands/feed.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to feed! Usage: \`${client.commands.get(`feed`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.feed().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** fed **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("feed.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "feed",
category: "Action",
description: "feed someone!",
usage: "feed [@user/user] (you can feed as many people as you want!)"
};

View file

@ -22,7 +22,7 @@ exports.conf = {
exports.help = { exports.help = {
name: "feedback", name: "feedback",
category: "Miscellaneous", category: "Utility",
description: "Send feedback to my developer.", description: "Send feedback to my developer.",
usage: "feedback [message]" usage: "feedback [message]"
}; };

30
src/commands/foxgirl.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.foxGirl().then((json) => {
message.channel.send(json.url)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("foxgirl.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "foxgirl",
category: "Image",
description: "Sends you pictures of fox girls.",
usage: "foxgirl"
};

View file

@ -3,7 +3,7 @@ exports.run = (client, message, args, level) => {
embed.setColor(client.embedColour(message)); embed.setColor(client.embedColour(message));
var ran = false; var ran = false;
var output = "```"; var output = "";
var commands = 0; var commands = 0;
var prefix; var prefix;
var currentCategory; var currentCategory;
@ -15,7 +15,7 @@ exports.run = (client, message, args, level) => {
}; };
if(!args[0]) { if(!args[0]) {
embed.setTitle(`Commands [${client.commands.size}]`); embed.setTitle(`Command list`);
embed.setDescription(`For more information on a specific command use \`${prefix}help <command>\`\nFor the full command list use \`${prefix}help all\`\n`); embed.setDescription(`For more information on a specific command use \`${prefix}help <command>\`\nFor the full command list use \`${prefix}help all\`\n`);
const myCommands = message.guild ? client.commands.filter( const myCommands = message.guild ? client.commands.filter(
@ -35,24 +35,20 @@ exports.run = (client, message, args, level) => {
); );
sorted.forEach( c => { sorted.forEach( c => {
const cat = c.help.category.toProperCase(); const cat = c.help.category;
if (currentCategory !== cat) { if (currentCategory !== cat) {
if(ran == true) { if(ran == true) {
output = output.slice(0, -2) + "```";
embed.addField(currentCategory + ` [${commands}]`, output) embed.addField(currentCategory + ` [${commands}]`, output)
output = "```"; output = "";
commands = 0; commands = 0;
} }
currentCategory = cat; currentCategory = cat;
ran = true ran = true
} }
output += `${prefix}${c.help.name}, `; output += `\`${c.help.name}\` `;
commands = commands + 1; commands = commands + 1;
}); });
output = output.slice(0, -2);
output = output + "```"
embed.addField(currentCategory + ` [${commands}]`, output); embed.addField(currentCategory + ` [${commands}]`, output);
embed.addField( embed.addField(
@ -72,7 +68,7 @@ exports.run = (client, message, args, level) => {
}; };
if(args[0].toLowerCase() == "all") { if(args[0].toLowerCase() == "all") {
embed.setTitle(`Commands [${client.commands.size}]`); embed.setTitle(`Command list`);
embed.setDescription(`For more information on a specific command use \`${prefix}help <command>\`\nFor the full command list use \`${prefix}help all\`\n`); embed.setDescription(`For more information on a specific command use \`${prefix}help <command>\`\nFor the full command list use \`${prefix}help all\`\n`);
const myCommands = client.commands const myCommands = client.commands
@ -88,22 +84,21 @@ exports.run = (client, message, args, level) => {
); );
sorted.forEach( c => { sorted.forEach( c => {
const cat = c.help.category.toProperCase(); const cat = c.help.category;
if (currentCategory !== cat) { if (currentCategory !== cat) {
if(ran == true) { if(ran == true) {
output = output.slice(0, -2) + "```";
embed.addField(currentCategory + ` [${commands}]`, output) embed.addField(currentCategory + ` [${commands}]`, output)
output = "```"; output = "";
commands = 0; commands = 0;
} }
currentCategory = cat; currentCategory = cat;
ran = true ran = true
} }
output += `${prefix}${c.help.name}, `; output += `\`${c.help.name}\` `;
commands = commands + 1; commands = commands + 1;
}); });
output = output.slice(0, -2) + "```";
embed.addField(currentCategory + ` [${commands}]`, output); embed.addField(currentCategory + ` [${commands}]`, output);
embed.addField( embed.addField(

69
src/commands/hug.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to hug! Usage: \`${client.commands.get(`hug`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.hug().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** hugged **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("hug.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "hug",
category: "Action",
description: "Hug someone!",
usage: "hug [@user/user] (you can hug as many people as you want!)"
};

View file

@ -16,7 +16,7 @@ exports.run = async (client, message, args) => {
if(!output) { if(!output) {
return message.channel.send("<:error:466995152976871434> No results for that query."); return message.channel.send("<:error:466995152976871434> No results for that query.");
}; };
return message.channel.send(`__**${output.name}**__\n${output.description}`); return message.channel.send(`__**${output.name.toProperCase()}**__\n${output.description}`);
}; };
}; };

View file

@ -1,20 +1,15 @@
const request = require('request') const fetch = require("node-fetch")
exports.run = async (client, message) => { exports.run = async (client, message) => {
message.channel.startTyping(); message.channel.startTyping();
request({ try {
url: "http://inspirobot.me/api?generate=true" fetch('http://inspirobot.me/api?generate=true')
}, .then(res => res.text())
function(error, res, body) { .then(body => message.channel.send({files: [new Discord.MessageAttachment(body)]}));
if(body.length > 0) {
message.channel.send({
files: [new Discord.MessageAttachment(body)]
});
message.channel.stopTyping(); message.channel.stopTyping();
} else { } catch (err) {
message.channel.send('<:error:466995152976871434> API error, please retry.') message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping(); message.channel.stopTyping();
}; };
});
}; };
exports.conf = { exports.conf = {

View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.kemonomimi().then((json) => {
message.channel.send(json.url)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("kemonomimi.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "kemonomimi",
category: "Image",
description: "Sends you pictures of people with animal characteristics.",
usage: "kemonomimi"
};

69
src/commands/kiss.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to kiss! Usage: \`${client.commands.get(`kiss`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.kiss().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** kissed **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("kiss.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "kiss",
category: "Action",
description: "Kiss someone!",
usage: "kiss [@user/user] (you can kiss as many people as you want!)"
};

30
src/commands/lizard.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.lizard().then((json) => {
message.channel.send(json.url)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("lizard.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "lizard",
category: "Image",
description: "Sends pictures of lizards.",
usage: "lizard"
};

30
src/commands/neko.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.neko().then((json) => {
message.channel.send(json.url);
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("neko.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["catgirl"],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "neko",
category: "Image",
description: "Sends you pictures of catgirls.",
usage: "neko"
};

30
src/commands/nekogif.js Normal file
View file

@ -0,0 +1,30 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.nekoGif().then((json) => {
message.channel.send(json.url);
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("nekogif.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["catgirlgif"],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "nekogif",
category: "Image",
description: "Sends you gifs of catgirls.",
usage: "nekogif"
};

View file

@ -13,8 +13,8 @@ exports.run = (client, message, args) => {
owoified = owoified.replace(/!+/g, ' ' + faces[~~(Math.random() * faces.length)] + ' ') owoified = owoified.replace(/!+/g, ' ' + faces[~~(Math.random() * faces.length)] + ' ')
if(owoified.length > 2000) { if(owoified.length > 2000) {
return message.channel.send("<:error:466995152976871434> The owoified message exceeds 2000 characters.") owoified = owoified.slice(0, -Math.abs(owoified.length - 2000))
} };
message.channel.send(owoified) message.channel.send(owoified)
}; };

69
src/commands/pat.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to pat! Usage: \`${client.commands.get(`pat`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.pat().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** patted **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("pat.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: ["headpat"],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "pat",
category: "Action",
description: "pat someone!",
usage: "pat [@user/user] (you can pat as many people as you want!)"
};

69
src/commands/poke.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to poke! Usage: \`${client.commands.get(`poke`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.poke().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** poked **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("poke.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "poke",
category: "Action",
description: "poke someone!",
usage: "poke [@user/user] (you can poke as many people as you want!)"
};

View file

@ -5,7 +5,7 @@ exports.run = async (client, message, args) => {
for (var key of Object.keys(pronouns)) { for (var key of Object.keys(pronouns)) {
output += `${key}, ` output += `${key}, `
}; };
return message.channel.send(`__**Pronouns**__\n${output.slice(0, -2)}`); return message.channel.send(`__**Pronouns:**__\n${output.slice(0, -2)}`);
} else { } else {
if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") { if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") {
return message.channel.send({ return message.channel.send({
@ -16,7 +16,7 @@ exports.run = async (client, message, args) => {
if(!output) { if(!output) {
return message.channel.send("<:error:466995152976871434> No results for that query."); return message.channel.send("<:error:466995152976871434> No results for that query.");
}; };
return message.channel.send(`__**Example sentences using ${output.name}**__\n${output.examples}`); return message.channel.send(`__**Example sentences using ${output.name}:**__\n${output.examples}`);
}; };
}; };

View file

@ -52,7 +52,6 @@ exports.run = async (client, message, args, level) => {
var embed = new Discord.MessageEmbed(); var embed = new Discord.MessageEmbed();
embed.setColor(role.color); embed.setColor(role.color);
embed.setTitle(role.name); embed.setTitle(role.name);
embed.setThumbnail("https://api.alexflipnote.xyz/colour/image/" + role.hexColor.replace("#", ""));
embed.setDescription( embed.setDescription(
`• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${role.hoist}` `• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${role.hoist}`
); );

View file

@ -5,7 +5,7 @@ exports.run = async (client, message, args) => {
for (var key of Object.keys(sexualities)) { for (var key of Object.keys(sexualities)) {
output += `${key}, ` output += `${key}, `
}; };
return message.channel.send(`__**sexualities**__\n${output.slice(0, -2)}`); return message.channel.send(`__**Sexualities:**__\n${output.slice(0, -2)}`);
} else { } else {
if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") { if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") {
return message.channel.send({ return message.channel.send({
@ -16,7 +16,7 @@ exports.run = async (client, message, args) => {
if(!output) { if(!output) {
return message.channel.send("<:error:466995152976871434> No results for that query."); return message.channel.send("<:error:466995152976871434> No results for that query.");
}; };
return message.channel.send(`__**${output.name}**__\n${output.description}`); return message.channel.send(`__**${output.name.toProperCase()}:**__\n${output.description}`);
}; };
}; };

View file

@ -31,7 +31,7 @@ exports.run = async (client, message, args) => {
name1 = args[1]; name1 = args[1];
}; };
shipName = name.substring(0, client.intBetween(1,name.length))+name1.substring(client.intBetween(0,name1.length)); shipName = name.substr(0, client.intBetween(1,name.length))+name1.substr(client.intBetween(0,name1.length));
message.channel.send(`__**Ship Generator:**__\n${hearts.random()} Ship Name: \`${shipName}\`\n${hearts.random()} Compatibility rating: \`${rating}%\``) message.channel.send(`__**Ship Generator:**__\n${hearts.random()} Ship Name: \`${shipName}\`\n${hearts.random()} Compatibility rating: \`${rating}%\``)
}; };

69
src/commands/slap.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to slap! Usage: \`${client.commands.get(`kiss`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.slap().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** slapped **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("slap.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "slap",
category: "Action",
description: "Slap someone >:3",
usage: "slap [@user/user] (you can slap as many people as you want!)"
};

33
src/commands/smug.js Normal file
View file

@ -0,0 +1,33 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message) => {
message.channel.startTyping();
try {
sfw.smug().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("smug.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "smug",
category: "Action",
description: "Sends a smug gif.",
usage: "smug"
};

View file

@ -0,0 +1,28 @@
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't provide any text! Usage: \`${client.commands.get(`spoiler`).help.usage}\``)
};
var output = `||${[...message.cleanContent.substring(9)].join("||||")}||`;
if(output.length > 2000) {
output = output.slice(0, -Math.abs(output.length - 2000))
};
message.channel.send(output)
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["spoilerize", "spoiler"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "spoilerise",
category: "Fun",
description: "Spoilers every letter in the provided text.",
usage: "spoiler [text]"
};

View file

@ -12,7 +12,7 @@ exports.conf = {
exports.help = { exports.help = {
name: "support", name: "support",
category: "utility", category: "Utility",
description: "Sends a link to Woomy's support/development server.", description: "Sends a link to Woomy's support/development server.",
usage: "support" usage: "support"
}; };

69
src/commands/tickle.js Normal file
View file

@ -0,0 +1,69 @@
const API = require('nekos.life');
const {sfw} = new API();
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't say who you wanted to tickle! Usage: \`${client.commands.get(`tickle`).help.usage}\``)
};
var people = "";
for (var i = 0; i < args.length; i++) {
var user = client.getUserFromMention(args[i])
if (user) {
user = message.guild.members.cache.get(user.id).displayName;
} else {
users = client.searchForMembers(message.guild, args[i]);
if (users.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users for `" + args[i] + "`, Please be more specific or mention the user instead."
);
else if (users.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = users[0].displayName;
};
if(i+1 == args.length && args.length > 1) {
people += `**and** ${user}!`
} else if(args.length < 2) {
people += `${user}!`;
} else if(args.length == 2 && i == 0) {
people += `${user} `;
} else {
people += `${user}, `;
};
};
message.channel.startTyping();
try {
sfw.tickle().then((json) => {
embed = new Discord.MessageEmbed();
embed.setImage(json.url)
embed.setColor(client.embedColour(message));
embed.setDescription(`**${message.guild.members.cache.get(message.author.id).displayName}** tickled **${people}**`)
message.channel.send(embed)
message.channel.stopTyping();
});
} catch (err) {
client.logger.error("tickle.js: " + err);
message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`)
message.channel.stopTyping();
};
};
exports.conf = {
enabled: true,
guildOnly: true,
aliases: [],
permLevel: "User",
requiredPerms: ["EMBED_LINKS"]
};
exports.help = {
name: "tickle",
category: "Action",
description: "Tickle someone!",
usage: "tickle [@user/user] (you can tickle as many people as you want!)"
};

View file

@ -6,14 +6,11 @@ exports.run = async (client, message, args, error) => {
); );
}; };
if(args.join(" ").toLowerCase() == "antarctica") {
return;
}
message.channel.startTyping(); message.channel.startTyping();
try {
weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) { weather.find({search: args.join(" "), degreeType: 'C'}, function(err, result) {
if(err) return client.logger.log(`weather.js error: ${JSON.stringify(error)}`, "error") if(err) return message.channel.send(`<:error:466995152976871434> API error: \`${error}\``)
if(result.length < 2 || !result) { if(result.length < 2 || !result) {
message.channel.stopTyping(); message.channel.stopTyping();
return message.channel.send("<:error:466995152976871434> City not found!"); return message.channel.send("<:error:466995152976871434> City not found!");
@ -38,13 +35,17 @@ exports.run = async (client, message, args, error) => {
}; };
embed = new Discord.MessageEmbed(); embed = new Discord.MessageEmbed();
embed.addField(`Weather for ${location.name}:`, `**Condition:** ${current.skytext}\n**Temperature:** ${current.temperature}\n**Feels like:** ${current.feelslike}\n**Humidity:** ${current.humidity}%\n**Wind:** ${current.winddisplay}\n**Warnings:** ${warning}`) embed.setAuthor(`Weather for ${location.name}:`)
embed.setDescription(`• **Condition:** ${current.skytext}\n• **Temperature:** ${current.temperature}°C\n• **Feels like:** ${current.feelslike}°C\n• **Humidity:** ${current.humidity}%\n• **Wind:** ${current.winddisplay}\n• **Warnings:** ${warning}`)
embed.setThumbnail(current.imageUrl) embed.setThumbnail(current.imageUrl)
embed.setFooter(`Last updated at ${current.observationtime} ${current.date}`) embed.setFooter(`Last updated at ${current.observationtime} ${current.date}`)
embed.setColor(embedColour) embed.setColor(embedColour)
message.channel.stopTyping(); message.channel.stopTyping();
message.channel.send(embed) message.channel.send(embed)
}); });
} catch(err) {
return message.channel.send(`<:error:466995152976871434> API error: \`${err}\``)
};
}; };
exports.conf = { exports.conf = {

View file

@ -1,19 +1,18 @@
const request = require('request') const fetch = require("node-fetch")
exports.run = async (client, message, args) => { exports.run = async (client, message, args) => {
const speech = args.join(' '); const speech = args.join(' ');
if (!speech) { if (!speech) {
return message.channel.send(`<:error:466995152976871434> Please include text for me to convert to yodish. Yes.`) return message.channel.send(`<:error:466995152976871434> Please include text for me to convert to yodish. Yes.`)
}; };
message.channel.startTyping(); message.channel.startTyping();
try{ try{
request({ uri: `http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`, json: true }, (error, response, body) => { fetch(`http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`)
message.channel.send(body.yodish); .then(res => res.json())
.then(json => message.channel.send(json.yodish));
message.channel.stopTyping(); message.channel.stopTyping();
});
} catch(err) { } catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`); message.channel.send(`<:error:466995152976871434> An error has occurred: ${err}`);
message.channel.stopTyping(); message.channel.stopTyping();
}; };
}; };
@ -21,14 +20,14 @@ exports.run = async (client, message, args) => {
exports.conf = { exports.conf = {
enabled: true, enabled: true,
guildOnly: false, guildOnly: false,
aliases: ["yoda","yodasay"], aliases: [],
permLevel: "User", permLevel: "User",
requiredPerms: [] requiredPerms: []
}; };
exports.help = { exports.help = {
name: "yodish", name: "yoda",
category: "Fun", category: "Fun",
description: "Turns any text you input into yodish. Yes.", description: "Turns any text you input into yodish. Yes.",
usage: "yodish <text>" usage: "yoda <text>"
}; };

30
src/commands/zalgo.js Normal file
View file

@ -0,0 +1,30 @@
const zalgo = require("to-zalgo")
exports.run = async (client, message, args) => {
if(!args[0]) {
return message.channel.send(`<:error:466995152976871434> You didn't provide any text! Usage: \`${client.commands.get(`zalgo`).help.usage}\``)
};
var output = zalgo(args.join(" "))
if(output.length > 2000) {
output = output.slice(0, -Math.abs(output.length - 2000))
};
message.channel.send(output)
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "zalgo",
category: "Fun",
description: "Spoilers every letter in the provided text.",
usage: "zalgo [text]"
};

View file

@ -8,11 +8,15 @@ module.exports = client => {
client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.version.number}`, 'ready'); client.logger.log(`Connected to Discord as ${client.user.tag} | v${client.version.number}`, 'ready');
let channel; let channel, channel1;
let channel1;
try { channel = client.guilds.cache.get('410990517841690625').channels.cache.get('570963998342643732'); } catch(err) {}; try {
try { channel1 = client.guilds.cache.get('410990517841690625').channels.cache.get('570963481189154822'); } catch(err) {}; channel = client.guilds.cache.get('410990517841690625').channels.cache.get('570963998342643732');
} catch(err) {};
try {
channel1 = client.guilds.cache.get('410990517841690625').channels.cache.get('570963481189154822');
} catch(err) {};
if(client.devmode == true) { if(client.devmode == true) {
client.logger.warn("Running in development mode.") client.logger.warn("Running in development mode.")
@ -21,13 +25,16 @@ module.exports = client => {
prefix = client.config.defaultSettings.prefix; prefix = client.config.defaultSettings.prefix;
channel.send(`\`${timestamp}\`: Ready event fired! Connected to ${client.users.cache.size} users in ${client.guilds.cache.size} guilds.`); channel.send(`\`${timestamp}\`: Ready event fired! Connected to ${client.users.cache.size} users in ${client.guilds.cache.size} guilds.`);
channel1.send(`\`${timestamp}\`: **Ready event fired**`); channel1.send(`\`${timestamp}\`: **Ready event fired**`);
} };
let randomActivity = activityArray.random(); let randomActivity = activityArray.random();
client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"}); client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"});
setInterval(() => { setInterval(() => {
randomActivity = activityArray.random(); randomActivity = activityArray.random();
if(client.lockActivity == false) client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"}); if(client.lockActivity == false) {
client.user.setActivity(`${prefix + randomActivity} | v${client.version.number}`, {type: "PLAYING"});
};
}, 30000); }, 30000);
}; };

View file

@ -1,7 +1,7 @@
const ytdl = require('ytdl-core-discord'); const ytdl = require('ytdl-core-discord');
const youtubeInfo = require('youtube-info'); const youtubeInfo = require('youtube-info');
const getYoutubeId = require('get-youtube-id'); const getYoutubeId = require('get-youtube-id');
const request = require('request'); const fetch = require('node-fetch');
module.exports = client => { module.exports = client => {
// Permission level function // Permission level function
@ -160,14 +160,17 @@ module.exports = client => {
{ {
return new Promise(function(resolve, reject) return new Promise(function(resolve, reject)
{ {
request("https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=" + encodeURIComponent(query) + "&key=" + client.config.ytkey, function(error, response, body) try{
{ fetch("https://www.googleapis.com/youtube/v3/search?part=id&type=video&q=" + encodeURIComponent(query) + "&key=" + client.config.ytkey)
if(error) throw error; .then(res => res.json())
.then(json => {
var json = JSON.parse(body);
if(!json.items) { reject(); return; } if(!json.items) { reject(); return; }
resolve(json.items[0]); resolve(json.items[0]);
}); });
} catch (err) {
client.logger.error("Music search err: ", err);
throw err;
};
}); });
} }
@ -374,6 +377,6 @@ module.exports = client => {
}); });
process.on("unhandledRejection", err => { process.on("unhandledRejection", err => {
client.logger.error(`Unhandled rejection: ${err}`); client.logger.error(`Unhandled rejection: ${err.stack}`);
}); });
}; };