forked from embee/woomy
synced changes
This commit is contained in:
parent
9be16b793e
commit
652b03136e
9 changed files with 215 additions and 27 deletions
|
@ -4,6 +4,7 @@
|
|||
"description": "Woomy is a all-purpose discord bot built off the guidebot base and coded in node.js using discord.js.",
|
||||
"main": "index.js",
|
||||
"dependencies": {
|
||||
"@discordjs/opus": "^0.1.0",
|
||||
"better-sqlite3": "^5.4.1",
|
||||
"chalk": "^3.0.0",
|
||||
"dblapi.js": "^2.3.1",
|
||||
|
@ -12,12 +13,13 @@
|
|||
"garfield": "^1.1.2",
|
||||
"get-youtube-id": "^1.0.1",
|
||||
"hastebin-gen": "^2.0.5",
|
||||
"is-url": "^1.2.4",
|
||||
"moment": "^2.24.0",
|
||||
"moment-duration-format": "^2.3.2",
|
||||
"prism-media": "^1.2.1",
|
||||
"randomcolor": "^0.5.4",
|
||||
"request": "^2.88.2",
|
||||
"relevant-urban": "^2.0.0",
|
||||
"request": "^2.88.2",
|
||||
"urban": "^0.3.2",
|
||||
"url-unshort": "^5.0.0",
|
||||
"url-unshorten": "^1.0.6",
|
||||
|
|
19
resources/other/coolpeople.json
Normal file
19
resources/other/coolpeople.json
Normal file
|
@ -0,0 +1,19 @@
|
|||
{
|
||||
"coolPeople": [
|
||||
"448354605617643520",
|
||||
"433790467830972417",
|
||||
"231777839576252417",
|
||||
"285992938314661899",
|
||||
"231704701433937931",
|
||||
"324937993972350976",
|
||||
"336492042299637771",
|
||||
"273867501006225419",
|
||||
"331870539897372672",
|
||||
"304000458144481280",
|
||||
"239787232666451980",
|
||||
"264970229514371072",
|
||||
"254310746450690048",
|
||||
"358390849807319040",
|
||||
"211011138656272386"
|
||||
]
|
||||
}
|
|
@ -3,14 +3,14 @@ const request = require("request");
|
|||
exports.run = async (bot, message, args) => {
|
||||
message.channel.startTyping();
|
||||
try{
|
||||
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
|
||||
message.channel.send(`**Did you know?**\n ${body.data[0].fact}`);
|
||||
message.channel.startTyping();
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
message.channel.stopTyping();
|
||||
};
|
||||
request({ uri: "https://catfact.ninja/facts", json: true }, (error, response, body) => {
|
||||
message.channel.send(`**Did you know?**\n ${body.data[0].fact}`);
|
||||
message.channel.stopTyping();
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
message.channel.stopTyping();
|
||||
};
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
|
|
53
src/commands/colourify.js
Normal file
53
src/commands/colourify.js
Normal file
|
@ -0,0 +1,53 @@
|
|||
const isURL = require("is-url")
|
||||
exports.run = async (client, message, args) => {
|
||||
var img;
|
||||
if(!args[0]) {
|
||||
if(!message.attachments.first()) {
|
||||
return message.channel.send("No attachment")
|
||||
};
|
||||
img = message.attachments.first().attachment;
|
||||
} else {
|
||||
if(isURL(args[0]) == true ) {
|
||||
img = args[0];
|
||||
} else {
|
||||
user = message.mentions.members.first();
|
||||
|
||||
if (!user) {
|
||||
let users;
|
||||
users = client.searchForMembers(message.guild, args[0]);
|
||||
if (users.length > 1)
|
||||
return message.channel.send(
|
||||
"<:error:466995152976871434> Found multiple users! 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];
|
||||
};
|
||||
|
||||
if(user) {
|
||||
img = user.user.avatarURL({format: "png", dynamic: true})
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
var attachment = new Discord.MessageAttachment(`https://api.alexflipnote.dev/filter/magik?image=${img}`)
|
||||
message.channel.send(attachment)
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
aliases: [],
|
||||
permLevel: "User",
|
||||
requiredPerms: []
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: "magikt",
|
||||
category: "Fun",
|
||||
description: "Colourifies an image",
|
||||
usage: "colourify user hex1 hex2"
|
||||
};
|
||||
|
|
@ -1,14 +1,49 @@
|
|||
const request = require('request')
|
||||
exports.run = async (client, message, args) => {
|
||||
|
||||
|
||||
//NOT FINISHED
|
||||
|
||||
if(!args[0] || !args[1]) {
|
||||
return message.channel.send(`<:error:466995152976871434> Please include two users`)
|
||||
}
|
||||
message.channel.startTyping();
|
||||
|
||||
var user = client.getUserFromMention(args[0])
|
||||
var user2 = client.getUserFromMention(args[1])
|
||||
|
||||
if (!user) {
|
||||
let users;
|
||||
users = client.searchForMembers(message.guild, args[0]);
|
||||
if (users.length > 1)
|
||||
return message.channel.send(
|
||||
"<:error:466995152976871434> Found multiple users! 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];
|
||||
};
|
||||
|
||||
if (!user2) {
|
||||
let users;
|
||||
users = client.searchForMembers(message.guild, args[0]);
|
||||
if (users.length > 1)
|
||||
return message.channel.send(
|
||||
"<:error:466995152976871434> Found multiple users! 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!"
|
||||
);
|
||||
user2 = users[0];
|
||||
};
|
||||
|
||||
var secondLength = Math.floor(user2.username.length / 2);
|
||||
|
||||
var first = user.username.substr(0, user.username.length / 2)
|
||||
var second = user2.username.substr(secondLength, user2.username.length / 2)
|
||||
var first = user.username.slice(0, user.username.length / 2)
|
||||
var second = user2.username.slice(secondLength, user2.username.length / 2)
|
||||
|
||||
try {
|
||||
var attachment = new Discord.MessageAttachment(`https://api.alexflipnote.dev/ship?user=${user.avatarURL({format: "png"})}&user2=${user2.avatarURL({format: "png"})}`)
|
||||
|
@ -22,7 +57,7 @@ exports.run = async (client, message, args) => {
|
|||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: false,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
permLevel: "User",
|
||||
requiredPerms: []
|
||||
|
|
65
src/commands/ship1.js
Normal file
65
src/commands/ship1.js
Normal file
|
@ -0,0 +1,65 @@
|
|||
const request = require('request')
|
||||
exports.run = async (client, message, args) => {
|
||||
|
||||
|
||||
//NOT FINISHED
|
||||
|
||||
if(!args[0] || !args[1]) {
|
||||
return message.channel.send(`<:error:466995152976871434> Please include two to five users`)
|
||||
}
|
||||
message.channel.startTyping();
|
||||
|
||||
var user = client.getUserFromMention(args[0])
|
||||
var user2 = client.getUserFromMention(args[1])
|
||||
|
||||
if (!user) {
|
||||
let users;
|
||||
users = client.searchForMembers(message.guild, args[0]);
|
||||
if (users.length > 1)
|
||||
return message.channel.send(
|
||||
"<:error:466995152976871434> Found multiple users! 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];
|
||||
};
|
||||
|
||||
if (!user2) {
|
||||
let users;
|
||||
users = client.searchForMembers(message.guild, args[0]);
|
||||
if (users.length > 1)
|
||||
return message.channel.send(
|
||||
"<:error:466995152976871434> Found multiple users! 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!"
|
||||
);
|
||||
user2 = users[0];
|
||||
};
|
||||
|
||||
var secondLength = Math.floor(user2.username.length / 2);
|
||||
|
||||
var first = user.username.slice(0, user.username.length / 2)
|
||||
var second = user2.username.slice(secondLength, user2.username.length / 2)
|
||||
|
||||
message.channel.send(`Your ship name is **${shipname}!**`)
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
guildOnly: true,
|
||||
aliases: [],
|
||||
permLevel: "User",
|
||||
requiredPerms: []
|
||||
};
|
||||
|
||||
exports.help = {
|
||||
name: "ship1",
|
||||
category: "Fun",
|
||||
description: "Ship two people together <3",
|
||||
usage: "ship name name2"
|
||||
};
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
const Discord = require("discord.js");
|
||||
|
||||
const coolPeople = require('../../resources/other/coolpeople.json')
|
||||
exports.run = (client, message, args) => {
|
||||
var user;
|
||||
var guild;
|
||||
|
@ -13,6 +13,8 @@ exports.run = (client, message, args) => {
|
|||
var tag;
|
||||
var id;
|
||||
var bot;
|
||||
var coolPerson = false;
|
||||
var friendos = coolPeople.coolPeople;
|
||||
|
||||
if(message.guild) {
|
||||
user = message.mentions.members.first();
|
||||
|
@ -39,6 +41,15 @@ exports.run = (client, message, args) => {
|
|||
nick = `\n• **Nickname:** ${user.nickname}`;
|
||||
};
|
||||
|
||||
for (var i = 0; i < friendos.length; i++) {
|
||||
if (user.user.id == friendos[i])
|
||||
coolPerson = true;
|
||||
};
|
||||
|
||||
if(coolPerson == true) {
|
||||
badges += "🌟"
|
||||
}
|
||||
|
||||
if(user.user.id == message.guild.ownerID) {
|
||||
badges += "<:owner:685703193694306331>"
|
||||
}
|
||||
|
@ -46,6 +57,7 @@ exports.run = (client, message, args) => {
|
|||
if(user.user.bot) {
|
||||
badges += "<:bot:686489601678114859>"
|
||||
}
|
||||
|
||||
|
||||
if(badges.length > 0) {
|
||||
badges += "\n"
|
||||
|
|
|
@ -1,20 +1,22 @@
|
|||
|
||||
const request = require('request')
|
||||
exports.run = async (client, message, args) => {
|
||||
const speech = args.join(' ');
|
||||
if (!args[0]) {
|
||||
return message.channel.send(`<:error:466995152976871434> Please include text for me to convert to yodish. Yes.`)
|
||||
}
|
||||
try {
|
||||
const { text } = request({ uri: `http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`, json: true }, (error, response, body) => {
|
||||
message.channel.send(JSON.parse(text).yodish)
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
message.channel.stopTyping();
|
||||
}
|
||||
const speech = args.join(' ');
|
||||
if (!speech) {
|
||||
return message.channel.send(`<:error:466995152976871434> Please include text for me to convert to yodish. Yes.`)
|
||||
};
|
||||
|
||||
}
|
||||
message.channel.startTyping();
|
||||
try{
|
||||
request({ uri: `http://yoda-api.appspot.com/api/v1/yodish?text=${encodeURIComponent(speech.toLowerCase())}`, json: true }, (error, response, body) => {
|
||||
message.channel.send(body.yodish);
|
||||
message.channel.stopTyping();
|
||||
});
|
||||
} catch(err) {
|
||||
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
|
||||
message.channel.stopTyping();
|
||||
};
|
||||
};
|
||||
|
||||
exports.conf = {
|
||||
enabled: true,
|
||||
|
|
|
@ -368,6 +368,6 @@ module.exports = client => {
|
|||
});
|
||||
|
||||
process.on("unhandledRejection", err => {
|
||||
client.logger.error(`Unhandled rejection: ${err.stack}`);
|
||||
client.logger.error(`Unhandled rejection: ${err}`);
|
||||
});
|
||||
};
|
||||
|
|
Loading…
Reference in a new issue