forked from embee/woomy
Did lots of things
This commit is contained in:
parent
2e85c85d3c
commit
ba0448c905
11 changed files with 115 additions and 112 deletions
|
@ -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})}`);
|
|
||||||
};
|
|
|
@ -11,7 +11,7 @@ exports.help = {
|
||||||
category: 'Utility',
|
category: 'Utility',
|
||||||
description: 'Enlarges and links an custom emoji',
|
description: 'Enlarges and links an custom emoji',
|
||||||
usage: 'emoji [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) => {
|
exports.run = async (client, message, args) => {
|
||||||
|
|
|
@ -44,6 +44,7 @@ exports.run = async (client, message, args, level, data) => {
|
||||||
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
message.channel.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``)
|
message.author.send(`\`ERROR\` \`\`\`xl\n${await errclean}\n\`\`\``)
|
||||||
|
message.react('⚠️')
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
exports.conf = {
|
exports.conf = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
guildOnly: false,
|
guildOnly: false,
|
||||||
aliases: ['commands', 'cmds', 'halp'],
|
aliases: ['commands', 'cmds'],
|
||||||
permLevel: 'User',
|
permLevel: 'User',
|
||||||
requiredPerms: ['EMBED_LINKS'],
|
requiredPerms: ['EMBED_LINKS'],
|
||||||
cooldown: 2000
|
cooldown: 2000
|
||||||
|
@ -9,10 +9,10 @@ exports.conf = {
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: 'help',
|
name: 'help',
|
||||||
category: 'General',
|
category: 'Bot',
|
||||||
description: 'Sends you a list of Woomy\'s commands.',
|
description: 'Lists all commands Woomy has, what they do, and how to use them.',
|
||||||
usage: '`help` - Lists all commands.\n`help <command>` - Receive more information on a command.',
|
usage: '`help` - Lists all commands.\n`help <command>` - Show detailed information on how to use the specified command.',
|
||||||
examples: '`help`\n`help roleinfo`'
|
parameters: '`command` - The name of the command you want more information on.'
|
||||||
}
|
}
|
||||||
|
|
||||||
const Discord = require('discord.js')
|
const Discord = require('discord.js')
|
||||||
|
@ -20,17 +20,21 @@ exports.run = (client, message, args, level, data) => {
|
||||||
const embed = new Discord.MessageEmbed()
|
const embed = new Discord.MessageEmbed()
|
||||||
embed.setColor(client.embedColour(message.guild))
|
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]) {
|
if (!args[0]) {
|
||||||
embed.setTitle('Woomy Commands')
|
const categories = []
|
||||||
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)`)
|
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
|
const commands = client.commands
|
||||||
|
|
||||||
commands.forEach((cmd) => {
|
commands.forEach((cmd) => {
|
||||||
|
@ -44,14 +48,13 @@ exports.run = (client, message, args, level, data) => {
|
||||||
|
|
||||||
categories.sort().forEach((cat) => {
|
categories.sort().forEach((cat) => {
|
||||||
const filtered = commands.filter((cmd) => cmd.help.category === 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) {
|
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)
|
return message.channel.send(embed)
|
||||||
} else {
|
} else {
|
||||||
const command = args.shift().toLowerCase()
|
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')
|
return message.channel.send('Command/alias doesn\'t exist')
|
||||||
}
|
}
|
||||||
|
|
||||||
let aliases
|
let aliases = ''
|
||||||
|
|
||||||
if (cmd.conf.aliases.length > 0) {
|
if (cmd.conf.aliases.length > 0) {
|
||||||
aliases = '`' + cmd.conf.aliases.join('`, `') + '`'
|
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.setTitle(cmd.help.category.toLowerCase() + ':' + cmd.help.name)
|
||||||
embed.setDescription(desc)
|
embed.setDescription(cmd.help.description)
|
||||||
embed.addField('**Usage**', cmd.help.usage)
|
embed.addField('**Usage**', cmd.help.usage)
|
||||||
if (cmd.help.examples.length > 0) {
|
|
||||||
embed.addField('**Examples**', cmd.help.examples)
|
|
||||||
}
|
|
||||||
if (aliases) {
|
if (aliases) {
|
||||||
embed.addField('**Aliases**', 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!')
|
embed.setFooter('< > = optional, [ ] = required. Don\'t include the brackets in the command itself!')
|
||||||
message.channel.send(embed)
|
message.channel.send(embed)
|
||||||
}
|
}
|
||||||
|
|
20
commands/invite.js
Normal file
20
commands/invite.js
Normal 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>`)
|
||||||
|
}
|
|
@ -9,7 +9,7 @@ exports.conf = {
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: 'level',
|
name: 'level',
|
||||||
category: 'Utility',
|
category: 'Bot',
|
||||||
description: 'Returns your permission level.',
|
description: 'Returns your permission level.',
|
||||||
usage: 'level',
|
usage: 'level',
|
||||||
params: ''
|
params: ''
|
||||||
|
|
|
@ -9,7 +9,7 @@ exports.conf = {
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: 'ping',
|
name: 'ping',
|
||||||
category: 'Utility',
|
category: 'Bot',
|
||||||
description: 'Displays bot latency in miliseconds.',
|
description: 'Displays bot latency in miliseconds.',
|
||||||
usage: 'ping',
|
usage: 'ping',
|
||||||
params: ''
|
params: ''
|
||||||
|
|
|
@ -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 url = 'https://demirramon.com/gen/pride.png'
|
||||||
const Discord = require('discord.js')
|
const Discord = require('discord.js')
|
||||||
exports.run = (client, message, args) => {
|
exports.run = (client, message, args) => {
|
||||||
const flag = args[0].toLowerCase()
|
const flag = args[0]
|
||||||
if (!flag) {
|
if (!flag) {
|
||||||
return message.channel.send(
|
return message.channel.send(client.userError(exports, 'Missing argument, the `flag` argument is required!'))
|
||||||
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get('pride').help.usage}\``
|
|
||||||
)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const available = ['lesbian', 'gay', 'bisexual', 'pansexual', 'trans', 'asexual', 'aromantic', 'ally']
|
const available = ['lesbian', 'gay', 'bisexual', 'pansexual', 'trans', 'asexual', 'aromantic', 'ally']
|
||||||
|
|
||||||
if (!available.includes(flag)) {
|
if (!available.includes(flag.toLowerCase())) {
|
||||||
return message.channel.send(`This flag isn't available. Available flags: \`${available.join('`, `')}\``)
|
return message.channel.send(`This flag isn't available, sorry ;~;\nAvailable flags: \`${available.join('`, `')}\``)
|
||||||
}
|
}
|
||||||
|
|
||||||
let gradient = 'false'
|
let gradient = 'false'
|
||||||
|
@ -21,7 +36,7 @@ exports.run = (client, message, args) => {
|
||||||
|
|
||||||
message.channel.startTyping()
|
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 {
|
try {
|
||||||
message.channel.stopTyping()
|
message.channel.stopTyping()
|
||||||
|
@ -31,21 +46,3 @@ exports.run = (client, message, args) => {
|
||||||
message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``)
|
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`'
|
|
||||||
}
|
|
||||||
|
|
|
@ -4,15 +4,16 @@ exports.conf = {
|
||||||
guildOnly: false,
|
guildOnly: false,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
permLevel: 'User',
|
permLevel: 'User',
|
||||||
requiredPerms: []
|
requiredPerms: [],
|
||||||
|
cooldown: 2000
|
||||||
}
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: 'ship',
|
name: 'ship',
|
||||||
category: 'Fun',
|
category: 'Fun',
|
||||||
description: 'Ship two people together <3',
|
description: 'Ship two people together <3',
|
||||||
usage: 'ship [name/user] [name/user]',
|
usage: 'ship `[name1]` `[name2]`',
|
||||||
params: ''
|
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')
|
const { MessageEmbed } = require('discord.js')
|
||||||
|
@ -28,8 +29,12 @@ exports.run = async (client, message, args, level, data) => {
|
||||||
'💜'
|
'💜'
|
||||||
]
|
]
|
||||||
|
|
||||||
if (args.length < 2) {
|
if (!args[0]) {
|
||||||
return message.channel.send('<:error:466995152976871434> Please include two names/users.')
|
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]
|
const firstName = args[0]
|
||||||
|
|
|
@ -1,18 +1,20 @@
|
||||||
exports.conf = {
|
exports.conf = {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
guildOnly: false,
|
guildOnly: false,
|
||||||
aliases: [],
|
aliases: [],
|
||||||
permLevel: 'User',
|
permLevel: 'User',
|
||||||
requiredPerms: []
|
requiredPerms: [],
|
||||||
};
|
cooldown: 2000
|
||||||
|
}
|
||||||
|
|
||||||
exports.help = {
|
exports.help = {
|
||||||
name: 'support',
|
name: 'support',
|
||||||
category: 'Utility',
|
category: 'Bot',
|
||||||
description: "Sends a link to my support/development server.",
|
description: 'Sends a link to my support/development server.',
|
||||||
usage: 'support'
|
usage: 'support',
|
||||||
};
|
parameters: ''
|
||||||
|
}
|
||||||
|
|
||||||
exports.run = async (client, message, args, level, data) =>{
|
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);
|
message.channel.send('Here you go! Hopefully we can help you here :3 https://discord.gg/HCF8mdv')
|
||||||
};
|
}
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
const { MessageEmbed } = require('discord.js')
|
||||||
const mongoose = require('mongoose')
|
const mongoose = require('mongoose')
|
||||||
const Guild = require('../models/guild')
|
const Guild = require('../models/guild')
|
||||||
const User = require('../models/user')
|
const User = require('../models/user')
|
||||||
|
@ -131,6 +132,18 @@ module.exports = client => {
|
||||||
return false
|
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
|
// Clean up input to remove @everyone, token, etc
|
||||||
client.clean = async (client, text) => {
|
client.clean = async (client, text) => {
|
||||||
if (text && text.constructor.name === 'Promise') {
|
if (text && text.constructor.name === 'Promise') {
|
||||||
|
|
Loading…
Reference in a new issue