diff --git a/commands/avataredit/3000years.js b/commands/avataredit/3000years.js index 1b55d3aa..3c86129b 100644 --- a/commands/avataredit/3000years.js +++ b/commands/avataredit/3000years.js @@ -24,7 +24,7 @@ module.exports = class YearsCommand extends Command { if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; - const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); + const userAvatar = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png'); let images = []; images.push(Jimp.read(userAvatar)); images.push(Jimp.read('https://i.imgur.com/eScwGFS.png')); diff --git a/commands/avataredit/beautiful.js b/commands/avataredit/beautiful.js index c15da07b..066a403a 100644 --- a/commands/avataredit/beautiful.js +++ b/commands/avataredit/beautiful.js @@ -24,7 +24,7 @@ module.exports = class BeautifulCommand extends Command { if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; - const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); + const userAvatar = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png'); let images = []; images.push(Jimp.read(userAvatar)); images.push(Jimp.read('https://i.imgur.com/OOQ9QwQ.jpg')); diff --git a/commands/avataredit/bobross.js b/commands/avataredit/bobross.js index d6800170..f7e5f9ec 100644 --- a/commands/avataredit/bobross.js +++ b/commands/avataredit/bobross.js @@ -24,7 +24,7 @@ module.exports = class BobRossCommand extends Command { if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; - const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); + const userAvatar = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png'); const blank = new Jimp(600, 775, 0xFFFFFF); let images = []; images.push(Jimp.read(userAvatar)); diff --git a/commands/avataredit/rip.js b/commands/avataredit/rip.js index e1e2af25..7e87923a 100644 --- a/commands/avataredit/rip.js +++ b/commands/avataredit/rip.js @@ -25,7 +25,7 @@ module.exports = class RIPCommand extends Command { if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES')) return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; - const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); + const userAvatar = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png'); let images = []; images.push(Jimp.read(userAvatar)); images.push(Jimp.read('https://i.imgur.com/KriteWm.jpg')); diff --git a/commands/avataredit/steamcard.js b/commands/avataredit/steamcard.js index da1de007..f046c7b6 100644 --- a/commands/avataredit/steamcard.js +++ b/commands/avataredit/steamcard.js @@ -25,7 +25,7 @@ module.exports = class SteamCardCommand extends Command { return message.say('This Command requires the `Attach Files` Permission.'); const { user } = args; const username = message.guild ? message.guild.member(user).displayName : user.username; - const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png'); + const userAvatar = user.displayAvatarURL.replace(/(png|jpg|jpeg|gif|webp)/, 'png'); const blank = new Jimp(494, 568, 0xFFFFFF); let images = []; images.push(Jimp.read(userAvatar)); diff --git a/package.json b/package.json index 342be6c1..aabd78fd 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "15.4.5", + "version": "16.0.1", "description": "A Discord Bot", "main": "shardingmanager.js", "scripts": {