Did lots of things

This commit is contained in:
Emily 2020-04-11 19:30:51 +10:00
parent 2e85c85d3c
commit ba0448c905
11 changed files with 115 additions and 112 deletions

View File

@ -1,39 +0,0 @@
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 'User',
requiredPerms: ['EMBED_LINKS']
};
exports.help = {
name: 'avatar',
category: 'Utility',
description: 'Gives you the specified users avatar.',
usage: 'avatar <user>',
params: ''
};
exports.run = (client, message, args) => {
let user = message.mentions.users.first();
let users;
if (!args[0] || !message.guild) {
user = message.author;
};
if (!user && message.guild) {
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];
user = user.user;
}
message.channel.send(`**${user.tag}'s** avatar is: ${user.avatarURL({format: 'png', dynamic: true, size: 2048})}`);
};

View File

@ -11,7 +11,7 @@ exports.help = {
category: 'Utility',
description: 'Enlarges and links an custom emoji',
usage: 'emoji [emoji]',
params: '`[emoji] - Discord emoji you want to enlarge.'
params: '`[emoji] - Custom emoji you want to enlarge.'
};
exports.run = async (client, message, args) => {

View File

@ -44,6 +44,7 @@ exports.run = async (client, message, args, level, data) => {
return
}
message.channel.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``)
message.author.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``)
message.react('⚠️')
}
}

View File

@ -1,7 +1,7 @@
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['commands', 'cmds', 'halp'],
aliases: ['commands', 'cmds'],
permLevel: 'User',
requiredPerms: ['EMBED_LINKS'],
cooldown: 2000
@ -9,10 +9,10 @@ exports.conf = {
exports.help = {
name: 'help',
category: 'General',
description: 'Sends you a list of Woomy\'s commands.',
usage: '`help` - Lists all commands.\n`help <command>` - Receive more information on a command.',
examples: '`help`\n`help roleinfo`'
category: 'Bot',
description: 'Lists all commands Woomy has, what they do, and how to use them.',
usage: '`help` - Lists all commands.\n`help <command>` - Show detailed information on how to use the specified command.',
parameters: '`command` - The name of the command you want more information on.'
}
const Discord = require('discord.js')
@ -20,17 +20,21 @@ exports.run = (client, message, args, level, data) => {
const embed = new Discord.MessageEmbed()
embed.setColor(client.embedColour(message.guild))
const prefixes = [data.user.prefix]
if (message.guild && data.user.prefix !== data.guild.prefix) {
prefixes.push(data.guild.prefix)
}
prefixes.push('@Woomy')
const categories = []
if (!args[0]) {
embed.setTitle('Woomy Commands')
embed.setDescription(`• Prefixes: ${'`' + prefixes.join('`, `') + '`'}\n• Use \`help <command>\` to recieve more information about a command!\n• [Join my support server](https://discord.gg/HCF8mdv)`)
const categories = []
let uPrefix = '`' + data.user.prefix + '`'
let gPrefix = '`' + data.guild.prefix + '`'
if (client.config.defaultPrefix === data.user.prefix) {
uPrefix = 'None set, use: `~myprefix'
}
if (client.config.defaultPrefix === data.guild.prefix) {
gPrefix = 'None set, use: `~prefix`'
}
embed.setTitle('Woomy Help')
embed.setDescription(`**Prefixes**\n» Default: \`${client.config.defaultPrefix}\`\n» Server: ${gPrefix}\n» Personal: ${uPrefix}\n\n» [Join my discord server](https://discord.gg/HCF8mdv) if you need help!\n» Use \`help <command>\` to recieve more information about a command!`)
const commands = client.commands
commands.forEach((cmd) => {
@ -44,14 +48,13 @@ exports.run = (client, message, args, level, data) => {
categories.sort().forEach((cat) => {
const filtered = commands.filter((cmd) => cmd.help.category === cat)
embed.addField(cat, filtered.map((cmd) => '`' + cmd.help.name + '`').join(', '))
embed.addField('**' + cat + '**', filtered.map((cmd) => '`' + cmd.help.name + '`').join(', '), true)
})
if (message.guild && data.guild.customCommands.length > 0) {
embed.addField('Custom', data.guild.customCommands.map((cmd) => '`' + cmd.name + '`').join(' '))
embed.addField('**Custom**', data.guild.customCommands.map((cmd) => '`' + cmd.name + '`').join(' '), true)
}
embed.addField('Invite', '[Invite](https://discordapp.com/oauth2/authorize?client_id=435961704145485835&permissions=8&scope=bot) | [Discord Server](https://discord.gg/HCF8mdv)')
return message.channel.send(embed)
} else {
const command = args.shift().toLowerCase()
@ -60,23 +63,24 @@ exports.run = (client, message, args, level, data) => {
return message.channel.send('Command/alias doesn\'t exist')
}
let aliases
let aliases = ''
if (cmd.conf.aliases.length > 0) {
aliases = '`' + cmd.conf.aliases.join('`, `') + '`'
}
const desc = cmd.help.description + `\n\n**You need the \`${cmd.conf.permLevel}\` rank to run this command! This command has a cooldown of \`${cmd.conf.cooldown / 1000}\` seconds per user.**`
embed.setTitle(cmd.help.category.toLowerCase() + ':' + cmd.help.name)
embed.setDescription(desc)
embed.setDescription(cmd.help.description)
embed.addField('**Usage**', cmd.help.usage)
if (cmd.help.examples.length > 0) {
embed.addField('**Examples**', cmd.help.examples)
}
if (aliases) {
embed.addField('**Aliases**', aliases)
}
if (cmd.help.parameters.length > 0) {
embed.addField('**Parameters**', cmd.help.parameters)
}
embed.addField('**Rank required**', cmd.conf.permLevel, true)
embed.addField('**Server only**', cmd.conf.guildOnly, true)
embed.addField('**Cooldown**', cmd.conf.cooldown / 1000 + ' seconds', true)
embed.setFooter('< > = optional, [ ] = required. Don\'t include the brackets in the command itself!')
message.channel.send(embed)
}

20
commands/invite.js Normal file
View File

@ -0,0 +1,20 @@
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 'User',
requiredPerms: [],
cooldown: 2000
}
exports.help = {
name: 'invite',
category: 'Bot',
description: 'Sends a link to my support/development server.',
usage: 'invite',
parameters: ''
}
exports.run = async (client, message, args, level, data) => {
message.channel.send(`Here you go! I hope you enjoy using me ^-^\n<https://discordapp.com/oauth2/authorize?client_id=${client.user.id}&permissions=2134240503&scope=bot>`)
}

View File

@ -9,7 +9,7 @@ exports.conf = {
exports.help = {
name: 'level',
category: 'Utility',
category: 'Bot',
description: 'Returns your permission level.',
usage: 'level',
params: ''

View File

@ -9,7 +9,7 @@ exports.conf = {
exports.help = {
name: 'ping',
category: 'Utility',
category: 'Bot',
description: 'Displays bot latency in miliseconds.',
usage: 'ping',
params: ''

View File

@ -1,17 +1,32 @@
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['flag'],
permLevel: 'User',
requiredPerms: ['ATTACH_FILES'],
cooldown: 15000
}
exports.help = {
name: 'pride',
category: 'Fun',
description: 'Adds a pride flag ring to your avatar. Available flags are lesbian, gay, bisexual, pansexual, trans, asexual, aromantic and ally. Generator created by [Demirramon.](https://demirramon.com/)',
usage: '`pride [flag]` - Adds a pride flag overlay to your avatar.\n`pride -g [flag]` - Adds a pride flag gradient on your avatar.',
parameters: '`flag` - What flag you want to add to your avatar (options listed above)\n`-g` - Add this to the start of the command to turn the flag into a gradient.'
}
const url = 'https://demirramon.com/gen/pride.png'
const Discord = require('discord.js')
exports.run = (client, message, args) => {
const flag = args[0].toLowerCase()
const flag = args[0]
if (!flag) {
return message.channel.send(
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get('pride').help.usage}\``
)
return message.channel.send(client.userError(exports, 'Missing argument, the `flag` argument is required!'))
}
const available = ['lesbian', 'gay', 'bisexual', 'pansexual', 'trans', 'asexual', 'aromantic', 'ally']
if (!available.includes(flag)) {
return message.channel.send(`This flag isn't available. Available flags: \`${available.join('`, `')}\``)
if (!available.includes(flag.toLowerCase())) {
return message.channel.send(`This flag isn't available, sorry ;~;\nAvailable flags: \`${available.join('`, `')}\``)
}
let gradient = 'false'
@ -21,7 +36,7 @@ exports.run = (client, message, args) => {
message.channel.startTyping()
const params = `image=${message.author.avatarURL({ format: 'png', size: 2048 })}&flag=${flag}&full=true&gradient=${gradient}&background=false&fit=true&v=2019-08-07`
const params = `image=${message.author.avatarURL({ format: 'png', size: 2048 })}&flag=${flag.toLowerCase()}&full=true&gradient=${gradient}&background=false&fit=true&v=2019-08-07`
try {
message.channel.stopTyping()
@ -31,21 +46,3 @@ exports.run = (client, message, args) => {
message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``)
}
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: ['flag'],
permLevel: 'User',
requiredPerms: ['ATTACH_FILES'],
cooldown: 20000
}
exports.help = {
name: 'pride',
category: 'Fun',
description: 'Adds a pride flag ring to your avatar. Available flags are lesbian, gay, bisexual, pansexual, trans, asexual, aromantic and ally. Generator created by [Demirramon.](https://demirramon.com/)',
flags: '`-g` - Makes the overlay a gradient.',
usage: '`pride [flag]` - Adds a pride flag overlay to your avatar.\n`pride [flag] -g` - Adds a pride flag gradient on your avatar.',
examples: '`pride trans`\n`pride lesbian -g`'
}

View File

@ -4,15 +4,16 @@ exports.conf = {
guildOnly: false,
aliases: [],
permLevel: 'User',
requiredPerms: []
requiredPerms: [],
cooldown: 2000
}
exports.help = {
name: 'ship',
category: 'Fun',
description: 'Ship two people together <3',
usage: 'ship [name/user] [name/user]',
params: ''
usage: 'ship `[name1]` `[name2]`',
parameters: '`name1` The name of the first person you want to ship.\n `name` The name of the second person you want to ship.'
}
const { MessageEmbed } = require('discord.js')
@ -28,8 +29,12 @@ exports.run = async (client, message, args, level, data) => {
'💜'
]
if (args.length < 2) {
return message.channel.send('<:error:466995152976871434> Please include two names/users.')
if (!args[0]) {
return message.channel.send(client.userError(exports, 'Missing argument, the `name1` argument is required!'))
}
if (!args[1]) {
return message.channel.send(client.userError(exports, 'Missing argument, the `name2` argument is required!'))
}
const firstName = args[0]

View File

@ -1,18 +1,20 @@
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 'User',
requiredPerms: []
};
enabled: true,
guildOnly: false,
aliases: [],
permLevel: 'User',
requiredPerms: [],
cooldown: 2000
}
exports.help = {
name: 'support',
category: 'Utility',
description: "Sends a link to my support/development server.",
usage: 'support'
};
name: 'support',
category: 'Bot',
description: 'Sends a link to my support/development server.',
usage: 'support',
parameters: ''
}
exports.run = async (client, message, args, level, data) =>{
message.channel.send('Use this link to join my support server: https://discord.gg/' + client.config.support.id);
};
exports.run = async (client, message, args, level, data) => {
message.channel.send('Here you go! Hopefully we can help you here :3 https://discord.gg/HCF8mdv')
}

View File

@ -1,3 +1,4 @@
const { MessageEmbed } = require('discord.js')
const mongoose = require('mongoose')
const Guild = require('../models/guild')
const User = require('../models/user')
@ -131,6 +132,18 @@ module.exports = client => {
return false
}
// Creates an embed for when commands are used incorrectly
client.userError = (cmd, err) => {
const embed = new MessageEmbed()
embed.setColor('#EF5350')
embed.setTitle(cmd.help.name + ':' + cmd.help.category.toLowerCase())
embed.setDescription(err)
embed.addField('**Usage**', cmd.help.usage)
embed.addField('**Parameters**', cmd.help.parameters)
embed.setFooter(`Run 'help ${cmd.help.name}' for more information.`)
return embed
}
// Clean up input to remove @everyone, token, etc
client.clean = async (client, text) => {
if (text && text.constructor.name === 'Promise') {