Synced changes

This commit is contained in:
Emily 2020-03-22 22:13:41 +11:00
parent 29e8198126
commit 282c61261d
13 changed files with 367 additions and 53 deletions

View file

@ -29,14 +29,14 @@ exports.run = (client, message, args) => {
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["calculate", "calc"],
aliases: ["calc", "math"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "math",
name: "calculate",
category: "Utility",
description: "Solves basic mathematical equations.",
usage: "math [equation]"
usage: "calculate [equation]"
};

View file

@ -11,7 +11,6 @@ exports.run = async (client, message, args) => {
format = ".gif"
};
console.log(string.length)
if(string.length > 18) {
ID = string.slice(string.length - 18);
} else {

View file

@ -6,8 +6,13 @@ exports.run = async (client, message, args) => {
output += `${key}, `
};
return message.channel.send(`__**Identities**__\n${output.slice(0, -2)}`);
} else {
output = identities[args[0].toLowerCase()];
} else {
if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") {
return message.channel.send({
files: [new Discord.MessageAttachment("./resources/images/attackhelicopter.jpg")]
});
}
output = identities[args.join(" ").toLowerCase()];
if(!output) {
return message.channel.send("<:error:466995152976871434> No results for that query.");
};
@ -18,7 +23,7 @@ exports.run = async (client, message, args) => {
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
aliases: ["identities"],
permLevel: "User",
requiredPerms: []
};

36
src/commands/pronoun.js Normal file
View file

@ -0,0 +1,36 @@
const pronouns = require ("../../resources/other/pronouns.json");
exports.run = async (client, message, args) => {
var output = "";
if(!args[0]) {
for (var key of Object.keys(pronouns)) {
output += `${key}, `
};
return message.channel.send(`__**Pronouns**__\n${output.slice(0, -2)}`);
} else {
if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") {
return message.channel.send({
files: [new Discord.MessageAttachment("./resources/images/attackhelicopter.jpg")]
});
};
output = pronouns[args.join(" ").toLowerCase()];
if(!output) {
return message.channel.send("<:error:466995152976871434> No results for that query.");
};
return message.channel.send(`__**Example sentences using ${output.name}**__\n${output.examples}`);
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["pronouns"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "pronoun",
category: "Fun",
description: "Gives you information on how to use the specified pronoun.",
usage: "pronoun [pronoun]"
};

36
src/commands/sexuality.js Normal file
View file

@ -0,0 +1,36 @@
const sexualities = require ("../../resources/other/sexualities.json");
exports.run = async (client, message, args) => {
var output = "";
if(!args[0]) {
for (var key of Object.keys(sexualities)) {
output += `${key}, `
};
return message.channel.send(`__**sexualities**__\n${output.slice(0, -2)}`);
} else {
if(args.join(" ").toLowerCase() == "attack helicopter" || args.join(" ").toLowerCase() == "apache attack helicopter" || args.join(" ").toLowerCase() == "apache") {
return message.channel.send({
files: [new Discord.MessageAttachment("./resources/images/attackhelicopter.jpg")]
});
}
output = sexualities[args.join(" ").toLowerCase()];
if(!output) {
return message.channel.send("<:error:466995152976871434> No results for that query.");
};
return message.channel.send(`__**${output.name}**__\n${output.description}`);
};
};
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ["sexualities"],
permLevel: "User",
requiredPerms: []
};
exports.help = {
name: "sexuality",
category: "Fun",
description: "Gives you information about the specified sexuality.",
usage: "sexuality [sexuality]"
};

View file

@ -1,51 +1,42 @@
const request = require('request')
exports.run = async (client, message, args) => {
//NOT FINISHED
var hearts = [
"❤️",
"🧡",
"💛",
"💚",
"💙",
"💜"
];
if(!args[0] || !args[1]) {
return message.channel.send(`<:error:466995152976871434> Please include two users`)
return message.channel.send(`<:error:466995152976871434> Please include at least two names.`)
}
message.channel.startTyping();
let users = [];
let names = [];
let totalLength = 0;
for(let i = 0; i < args.length; i++) {
let arg = args[i];
let user = client.getUserFromMention(arg);
if(!user) {
let usersFound;
usersFound = client.searchForMembers(message.guild, arg);
if (usersFound.length > 1)
return message.channel.send(
"<:error:466995152976871434> Found multiple users! Please be more specific or mention the user instead."
);
else if (usersFound.length == 0)
return message.channel.send(
"<:error:466995152976871434> That user doesn't seem to exist. Try again!"
);
user = usersFound[0].user;
}
users.push(user);
totalLength += user.username.length;
let name = client.getUserFromMention(arg).username;
if(!name) {
name = arg;
};
names.push(name);
totalLength += arg.length;
}
let lengthPerUser = Math.floor(totalLength / users.length);
let lengthPerName = Math.floor(totalLength / names.length);
let finalName = '';
let last = -1;
for(let i = 0; i < users.length; i++) {
let user = users[i];
let l = Math.min(lengthPerUser, user.username.length);
for(let i = 0; i < names.length; i++) {
let name = names[i];
let l = Math.min(lengthPerName, name.length);
let p = user.username.substr(last + 1, last + l);
let p = name.substr(last + 1, last + l);
console.log(p);
@ -55,18 +46,11 @@ exports.run = async (client, message, args) => {
};
console.log(totalLength);
console.log(users.length);
console.log(lengthPerUser);
console.log(names.length);
console.log(lengthPerName);
console.log(finalName);
try {
//var attachment = new Discord.MessageAttachment(`https://api.alexflipnote.dev/ship?user=${user.avatarURL({format: "png"})}&user2=${user2.avatarURL({format: "png"})}`)
message.channel.send(`Your ship name is **${finalName}!**`)
message.channel.stopTyping();
} catch(err) {
message.channel.send(`<:error:466995152976871434> API error: ${err}`);
message.channel.stopTyping();
};
message.channel.send(`**Ship generator:**\n${hearts.random()} Ship name: \`${finalName}\`\n${hearts.random()} Compatibility rating:`)
};
exports.conf = {