Added pride and stuff

This commit is contained in:
Emily 2020-04-10 12:57:04 +10:00
parent 1b013581de
commit 956f4132c7
3 changed files with 60 additions and 6 deletions

View file

@ -60,13 +60,13 @@ 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 desc = '' let aliases
if (cmd.conf.aliases.length > 0) { if (cmd.conf.aliases.length > 0) {
desc += `*(Aliases: ${cmd.conf.aliases.join(', ')})*\n\n` aliases = '`' + cmd.conf.aliases.join('`, `') + '`'
} }
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.**` 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(desc)
@ -74,6 +74,9 @@ exports.run = (client, message, args, level, data) => {
if (cmd.help.examples.length > 0) { if (cmd.help.examples.length > 0) {
embed.addField('**Examples**', cmd.help.examples) embed.addField('**Examples**', cmd.help.examples)
} }
if (aliases) {
embed.addField('**Aliases**', aliases)
}
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)
} }

51
commands/pride.js Normal file
View file

@ -0,0 +1,51 @@
const url = 'https://demirramon.com/gen/pride.png'
const Discord = require('discord.js')
exports.run = (client, message, args) => {
const flag = args[0].toLowerCase()
if (!flag) {
return message.channel.send(
`<:error:466995152976871434> No message provided. Usage: \`${client.commands.get('pride').help.usage}\``
)
}
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('`, `')}\``)
}
let gradient = 'false'
if (message.flags.includes('g')) {
gradient = 'true'
}
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`
try {
message.channel.stopTyping()
message.channel.send({ files: [new Discord.MessageAttachment(url + '?' + params)] })
} catch (err) {
message.channel.stopTyping()
message.channel.send(`<:error:466995152976871434> Error when generating image: \`${err}\``)
}
}
exports.conf = {
enabled: true,
guildOnly: false,
aliases: [],
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/)',
usage: '`pride [flag]` - Adds a pride flag overlay to your avatar.\n`pride [flag] -g` - Adds a pride flag gradient on your avatar.',
flags: '`-g` - Makes the overlay a gradient.',
examples: '`pride trans`\n`pride lesbian -g`'
}

View file

@ -109,10 +109,10 @@ const init = async () => {
await client.db.init(client) await client.db.init(client)
// Login to Discord // Login to Discord
function failedToLogin(err) { function failedToLogin (err) {
client.logger.error('Failed to login: ' + err); client.logger.error('Failed to login: ' + err)
process.exit(0); process.exit(0)
}; };
if (client.devmode !== true) { if (client.devmode !== true) {