From 7a1964fb4ca39de494b2f599319b2929bda04dbd Mon Sep 17 00:00:00 2001 From: mudkipscience Date: Sat, 30 May 2020 13:55:04 +1000 Subject: [PATCH] pride update cause i couldn't wait until june --- src/commands/pride.js | 48 +++++++++++++++++++++++++++++++++++++++++++ src/modules/music.js | 4 ++-- version.json | 2 +- 3 files changed, 51 insertions(+), 3 deletions(-) create mode 100644 src/commands/pride.js diff --git a/src/commands/pride.js b/src/commands/pride.js new file mode 100644 index 0000000..92ec057 --- /dev/null +++ b/src/commands/pride.js @@ -0,0 +1,48 @@ +// Copyright 2020 Emily J. / mudkipscience and contributors. Subject to the AGPLv3 license. + +exports.conf = { + enabled: true, + guildOnly: false, + aliases: [], + permLevel: 'User', + requiredPerms: ['ATTACH_FILES'], +} + +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.', + usage: '`pride [flag]` - Adds a pride flag overlay to your avatar.\n`pride -g [flag]` - Adds a pride flag gradient on your avatar.', +} + +const url = 'https://demirramon.com/gen/pride.png' +const Discord = require('discord.js') +exports.run = (client, message, args) => { + const flag = args[0] + if (!flag) { + return client.userError(message, exports, 'Missing argument, the `flag` argument is required!') + } + + const available = ['lesbian', 'gay', 'bisexual', 'pansexual', 'trans', 'asexual', 'aromantic', 'ally'] + + if (!available.includes(flag.toLowerCase())) { + return message.channel.send(`<:error:466995152976871434> This flag isn't available, sorry ;~;\nAvailable 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.toLowerCase()}&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}\``) + } +} \ No newline at end of file diff --git a/src/modules/music.js b/src/modules/music.js index 2eb3b5d..6c9d811 100644 --- a/src/modules/music.js +++ b/src/modules/music.js @@ -203,8 +203,8 @@ exports.play = async function (client, message, query, playNext, ignoreQueue) { } client.logger.error('(YT API change, disregard) ' + err) - // return message.channel.send(`<:error:466995152976871434> An error has occured! If this issue persists, please contact my developers with this:\n\`${err}\``) - return message.channel.send('<:error:466995152976871434> YouTube have made changes to their site that break Woomy\'s music module. An announcement will be made in the development server when this issue is resolved.') + return message.channel.send(`<:error:466995152976871434> An error has occured: \n\`${err}\``) + // return message.channel.send('<:error:466995152976871434> YouTube have made changes to their site that break Woomy\'s music module. An announcement will be made in the development server when this issue is resolved.') } guild.dispatcher.setVolume(0.25) diff --git a/version.json b/version.json index a0e07a1..c095bb6 100644 --- a/version.json +++ b/version.json @@ -1,4 +1,4 @@ { - "number": "1.3.2", + "number": "1.3.3", "changelog": "**1.3.0 Changelog:**\n> • Music module has been rewritten for better stability and lots more features\n> • Force disconnecting Woomy from a voice channel no longer breaks music\n> • Music should (hopefully) break less in general\n> • Existing music commands have been rewritten\n> • Added the following new commands: fixmusic, movehere, movesong, playnext, shuffle, songinfo, volume\n> • Updated ship command\n**Notes:**\n> • This will be the final major update to Woomy V1, as we are shifting our focus to Woomy V2, which is a complete rewrite." }