This is a better way of reading profile pics

This commit is contained in:
Daniel Odendahl Jr
2017-04-27 00:57:15 +00:00
parent 041ae7fb7c
commit 9c4cb0b738
6 changed files with 6 additions and 6 deletions
+1 -1
View File
@@ -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'));
+1 -1
View File
@@ -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'));
+1 -1
View File
@@ -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));
+1 -1
View File
@@ -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'));
+1 -1
View File
@@ -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));
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiaobot",
"version": "15.4.5",
"version": "16.0.1",
"description": "A Discord Bot",
"main": "shardingmanager.js",
"scripts": {