Synced changes

This commit is contained in:
Emily 2020-03-23 00:01:54 +11:00
parent 282c61261d
commit 063a5ab465
7 changed files with 72 additions and 48 deletions

View file

@ -3,11 +3,15 @@ Links to avatars now lead to the original file size
Bots now get a bot badge in the userinfo command Bots now get a bot badge in the userinfo command
Added dogfact and catfact command (terry) Added dogfact and catfact command (terry)
index.js now has better logging of when things fail to load/initialize (terry) index.js now has better logging of when things fail to load/initialize (terry)
added `dice`, rolls a 6 sided die (terry) added `dice`, rolls a sided die (terry)
Help command changed, the amount of commands in each category and overall is now displayed and formatting changed Help command changed, the amount of commands in each category and overall is now displayed and formatting changed
added `inspire` as an alias for inspirobot added `inspire` as an alias for inspirobot
ship command ship command
added find by mention to functions added find by mention to functions
you can now @mention the bot to run commands you can now @mention the bot to run commands
added identity command, has definitions of gender identities and stuff added identity command, has definitions of gender identities and stuff
added pronouns command, tells you how to use pronouns
added sexuality command, has definitions of sexualities
renamed math calculate renamed math calculate
fixed woomy in dms
roleinfo now displays what permissions a role has and also the role colour in the thumbnail

View file

@ -22,6 +22,6 @@ exports.run = async (bot, message, args) => {
name: "dice", name: "dice",
category: "Fun", category: "Fun",
description: "Rolls a dice.", description: "Rolls a dice.",
usage: "dice" usage: "dice **OR** dice <number>"
}; };

View file

@ -15,17 +15,48 @@ exports.run = async (client, message, args, level) => {
return message.channel.send(`<:error:466995152976871434> Role not found.`) return message.channel.send(`<:error:466995152976871434> Role not found.`)
} }
if(role.hoist === true) { var permissions = "```";
var hoist = `Yes` if(role.permissions.has("ADMINISTRATOR")) permissions += "ADMINISTRATOR, ";
} else { if(role.permissions.has("CREATE_INSTANT_INVITE")) permissions += "CREATE_INSTANT_INVITE, ";
var hoist = `No` if(role.permissions.has("KICK_MEMBERS")) permissions += "KICK_MEMBERS, ";
} if(role.permissions.has("BAN_MEMBERS")) permissions += "BAN_MEMBERS, ";
if(role.permissions.has("MANAGE_CHANNELS")) permissions += "MANAGE_CHANNELS, ";
if(role.permissions.has("MANAGE_GUILD")) permissions += "MANAGE_GUILD, ";
if(role.permissions.has("ADD_REACTIONS")) permissions += "ADD_REACTIONS, ";
if(role.permissions.has("VIEW_AUDIT_LOG")) permissions += "VIEW_AUDIT_LOG, ";
if(role.permissions.has("PRIORITY_SPEAKER")) permissions += "PRIORITY_SPEAKER, ";
if(role.permissions.has("STREAM")) permissions += "STREAM, ";
if(role.permissions.has("VIEW_CHANNEL")) permissions += "VIEW_CHANNEL, ";
if(role.permissions.has("SEND_MESSAGES")) permissions += "SEND_MESSAGES, ";
if(role.permissions.has("SEND_TTS_MESSAGES")) permissions += "SEND_TTS_MESSAGES, ";
if(role.permissions.has("MANAGE_MESSAGES")) permissions += "MANAGE_MESSAGES, ";
if(role.permissions.has("EMBED_LINKS")) permissions += "EMBED_LINKS, ";
if(role.permissions.has("ATTACH_FILES")) permissions += "ATTACH_FILES, ";
if(role.permissions.has("READ_MESSAGE_HISTORY")) permissions += "READ_MESSAGE_HISTORY, ";
if(role.permissions.has("MENTION_EVERYONE")) permissions += "MENTION_EVERYONE, ";
if(role.permissions.has("USE_EXTERNAL_EMOJIS")) permissions += "USE_EXTERNAL_EMOJIS, ";
if(role.permissions.has("CONNECT")) permissions += "CONNECT, ";
if(role.permissions.has("SPEAK")) permissions += "SPEAK, ";
if(role.permissions.has("MUTE_MEMBERS")) permissions += "MUTE_MEMBERS, ";
if(role.permissions.has("DEAFEN_MEMBERS")) permissions += "DEAFEN_MEMBERS, ";
if(role.permissions.has("MOVE_MEMBERS")) permissions += "MOVE_MEMBERS, ";
if(role.permissions.has("USE_VAD")) permissions += "USE_VAD, ";
if(role.permissions.has("CHANGE_NICKNAME")) permissions += "CHANGE_NICKNAME, ";
if(role.permissions.has("MANAGE_NICKNAMES")) permissions += "MANAGE_NICKNAMES, ";
if(role.permissions.has("MANAGE_ROLES")) permissions += "MANAGE_ROLES, ";
if(role.permissions.has("MANAGE_WEBHOOKS")) permissions += "MANAGE_WEBHOOKS, ";
if(role.permissions.has("MANAGE_EMOJIS")) permissions += "MANAGE_EMOJIS, ";
permissions = permissions.slice(0, -2);
permissions += "```";
var embed = new Discord.MessageEmbed(); var embed = new Discord.MessageEmbed();
embed.setColor(role.color) embed.setColor(role.color);
embed.setTitle(role.name);
embed.setThumbnail("https://api.alexflipnote.xyz/colour/image/" + role.hexColor.replace("#", ""));
embed.setDescription( embed.setDescription(
`• **Name:** ${role.name}\n• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${hoist}` `• **ID:** ${role.id}\n• **Hex:** ${role.hexColor}\n• **Members:** ${role.members.size}\n• **Position:** ${role.position}\n• **Hoisted:** ${role.hoist}`
); );
embed.addField(`**Permissions:**`, permissions)
message.channel.send(embed) message.channel.send(embed)
}; };

View file

@ -1,5 +1,7 @@
exports.run = async (client, message, args) => { exports.run = async (client, message, args) => {
var name, name1;
var rating = Math.floor(Math.random() * 100) + 1;
var hearts = [ var hearts = [
"❤️", "❤️",
"🧡", "🧡",
@ -9,53 +11,34 @@ exports.run = async (client, message, args) => {
"💜" "💜"
]; ];
if(!args[0] || !args[1]) { if(args.length < 2) {
return message.channel.send(`<:error:466995152976871434> Please include at least two names.`) return message.channel.send(`<:error:466995152976871434> Please include two names/users.`)
} }
let names = []; if(message.guild && message.mentions.members && message.mentions.members.size > 0) {
let totalLength = 0; name = message.mentions.members.first().displayName;
};
if(message.guild && message.mentions.members && message.mentions.members.size > 1) {
name1 = message.mentions.members.last().displayName;
};
for(let i = 0; i < args.length; i++) {
let arg = args[i];
let name = client.getUserFromMention(arg).username;
if(!name) { if(!name) {
name = arg; name = args[0];
};
names.push(name);
totalLength += arg.length;
}
let lengthPerName = Math.floor(totalLength / names.length);
let finalName = '';
let last = -1;
for(let i = 0; i < names.length; i++) {
let name = names[i];
let l = Math.min(lengthPerName, name.length);
let p = name.substr(last + 1, last + l);
console.log(p);
finalName = finalName + p;
last = last + l;
}; };
console.log(totalLength); if(!name1) {
console.log(names.length); name1 = args[1];
console.log(lengthPerName); };
console.log(finalName);
message.channel.send(`**Ship generator:**\n${hearts.random()} Ship name: \`${finalName}\`\n${hearts.random()} Compatibility rating:`) shipName = name.substring(0, client.intBetween(1,name.length))+name1.substring(client.intBetween(0,name1.length));
message.channel.send(`__**Ship Generator:**__\n${hearts.random()} Ship Name: \`${shipName}\`\n${hearts.random()} Compatibility rating: \`${rating}%\``)
}; };
exports.conf = { exports.conf = {
enabled: true, enabled: true,
guildOnly: true, guildOnly: false,
aliases: [], aliases: [],
permLevel: "User", permLevel: "User",
requiredPerms: [] requiredPerms: []

View file

@ -158,7 +158,7 @@ module.exports = async (client, message) => {
.then(m => m.delete(2000)); .then(m => m.delete(2000));
}; };
if (!perms.has('SEND_MESSAGES')) { if (message.guild && !perms.has('SEND_MESSAGES')) {
return message.author.send(`<:error:466995152976871434> I don't have permission to speak in **#${message.channel.name}**, Please ask a moderator to give me the send messages permission!`); return message.author.send(`<:error:466995152976871434> I don't have permission to speak in **#${message.channel.name}**, Please ask a moderator to give me the send messages permission!`);
}; };

View file

@ -340,6 +340,12 @@ module.exports = client => {
}; };
}; };
// FIND RANDOM INT BETWEEN TWO INTEGERS
client.intBetween = function(min, max){
return Math.round((Math.random() * (max - min))+min);
};
// <String>.toPropercase() returns a proper-cased string // <String>.toPropercase() returns a proper-cased string
Object.defineProperty(String.prototype, "toProperCase", { Object.defineProperty(String.prototype, "toProperCase", {
value: function() { value: function() {