mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 10:02:05 +02:00
External File Storage for Photos
This commit is contained in:
@@ -27,7 +27,7 @@ module.exports = class YearsCommand extends Command {
|
||||
const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png');
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read('./images/3000years.png'));
|
||||
images.push(Jimp.read('https://i.imgur.com/eScwGFS.png'));
|
||||
const [avatar, years] = await Promise.all(images);
|
||||
avatar.resize(200, 200);
|
||||
years.blit(avatar, 461, 127);
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = class BeautifulCommand extends Command {
|
||||
const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png');
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read('./images/beautiful.jpg'));
|
||||
images.push(Jimp.read('https://i.imgur.com/OOQ9QwQ.jpg'));
|
||||
const [avatar, beautiful] = await Promise.all(images);
|
||||
avatar.resize(200, 200);
|
||||
beautiful.blit(avatar, 432, 42);
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = class BobRossCommand extends Command {
|
||||
const blank = new Jimp(600, 775, 0xFFFFFF);
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read('./images/BobRoss.png'));
|
||||
images.push(Jimp.read('https://i.imgur.com/7NSiFLd.png'));
|
||||
const [avatar, bob] = await Promise.all(images);
|
||||
avatar.rotate(2);
|
||||
avatar.resize(300, 300);
|
||||
|
||||
@@ -28,7 +28,7 @@ module.exports = class RIPCommand extends Command {
|
||||
const userAvatar = user.displayAvatarURL.replace('.jpg', '.png').replace('.gif', '.png');
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read('./images/gravestone.png'));
|
||||
images.push(Jimp.read('https://i.imgur.com/KriteWm.jpg'));
|
||||
const [avatar, gravestone] = await Promise.all(images);
|
||||
avatar.resize(200, 200);
|
||||
gravestone.blit(avatar, 158, 51);
|
||||
|
||||
@@ -29,7 +29,7 @@ module.exports = class SteamCardCommand extends Command {
|
||||
const blank = new Jimp(494, 568, 0xFFFFFF);
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read('./images/SteamCard.png'));
|
||||
images.push(Jimp.read('https://i.imgur.com/JF0WwQX.png'));
|
||||
const [avatar, steamcard] = await Promise.all(images);
|
||||
const font = await Jimp.loadFont(Jimp.FONT_SANS_32_WHITE);
|
||||
avatar.resize(450, 450);
|
||||
|
||||
@@ -27,7 +27,7 @@ module.exports = class WarnCommand extends Command {
|
||||
}
|
||||
|
||||
hasPermission(msg) {
|
||||
return msg.member.permissions.has('MANAGE_MESSAGES');
|
||||
return msg.member.permissions.has('KICK_MEMBERS');
|
||||
}
|
||||
|
||||
async run(message, args) {
|
||||
|
||||
@@ -14,6 +14,6 @@ module.exports = class SpamCommand extends Command {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
return message.channel.send({files: ['./images/Spam.jpg']});
|
||||
return message.channel.send({files: ['https://i.imgur.com/2JFu5xE.jpg']});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -19,6 +19,6 @@ module.exports = class CatCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
const cat = cats[Math.floor(Math.random() * cats.length)];
|
||||
return message.channel.send({files: [`./images/Cat${cat}`]});
|
||||
return message.channel.send({files: [cat]});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,22 +1,22 @@
|
||||
[
|
||||
"1.jpg",
|
||||
"2.jpg",
|
||||
"3.jpg",
|
||||
"4.jpg",
|
||||
"5.jpg",
|
||||
"6.jpg",
|
||||
"7.jpg",
|
||||
"8.jpg",
|
||||
"9.jpg",
|
||||
"10.jpg",
|
||||
"11.jpeg",
|
||||
"12.jpg",
|
||||
"13.jpeg",
|
||||
"14.png",
|
||||
"15.jpg",
|
||||
"16.jpg",
|
||||
"17.jpg",
|
||||
"18.jpg",
|
||||
"19.jpg",
|
||||
"20.jpg"
|
||||
"https://i.imgur.com/BYIsrcy.jpg",
|
||||
"https://i.imgur.com/4huevNv.jpg",
|
||||
"https://i.imgur.com/I52wMLL.jpg",
|
||||
"https://i.imgur.com/51xZFRg.jpg",
|
||||
"https://i.imgur.com/4CfKp58.jpg",
|
||||
"https://i.imgur.com/vNU99Ix.jpg",
|
||||
"https://i.imgur.com/Fvru0x5.jpg",
|
||||
"https://i.imgur.com/pBbf7gu.jpg",
|
||||
"https://i.imgur.com/A7UjE8I.jpg",
|
||||
"https://i.imgur.com/qfGSFCa.jpg",
|
||||
"https://i.imgur.com/e3isfmE.jpg",
|
||||
"https://i.imgur.com/kEDeoUT.jpg",
|
||||
"https://i.imgur.com/pta9FML.jpg",
|
||||
"https://i.imgur.com/HKhVeiV.jpg",
|
||||
"https://i.imgur.com/1qpQesN.jpg",
|
||||
"https://i.imgur.com/lEeoU0b.jpg",
|
||||
"https://i.imgur.com/VINBpuw.jpg",
|
||||
"https://i.imgur.com/1dp1koX.jpg",
|
||||
"https://i.imgur.com/N586OTx.jpg",
|
||||
"https://i.imgur.com/0T1ykQI.jpg"
|
||||
]
|
||||
|
||||
@@ -1,24 +0,0 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const potatoes = require('./potatoes');
|
||||
|
||||
module.exports = class PotatoCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'potato',
|
||||
aliases: [
|
||||
'tater'
|
||||
],
|
||||
group: 'randomimg',
|
||||
memberName: 'potato',
|
||||
description: 'Sends a random potato image.'
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
const potato = potatoes[Math.floor(Math.random() * potatoes.length)];
|
||||
return message.channel.send({files: [`./images/Potato${potato}`]});
|
||||
}
|
||||
};
|
||||
@@ -1,11 +0,0 @@
|
||||
[
|
||||
"1.jpg",
|
||||
"2.jpg",
|
||||
"3.jpg",
|
||||
"4.jpg",
|
||||
"5.gif",
|
||||
"6.png",
|
||||
"7.jpg",
|
||||
"8.jpg",
|
||||
"9.jpg"
|
||||
]
|
||||
@@ -1,21 +0,0 @@
|
||||
const { Command } = require('discord.js-commando');
|
||||
const puns = require('./puns');
|
||||
|
||||
module.exports = class RandomPunCommand extends Command {
|
||||
constructor(client) {
|
||||
super(client, {
|
||||
name: 'pun',
|
||||
group: 'randomimg',
|
||||
memberName: 'pun',
|
||||
description: 'Sends a random pun image.'
|
||||
});
|
||||
}
|
||||
|
||||
run(message) {
|
||||
if (message.channel.type !== 'dm')
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
const pun = puns[Math.floor(Math.random() * puns.length)];
|
||||
return message.channel.send({files: [`./images/Pun${pun}`]});
|
||||
}
|
||||
};
|
||||
@@ -1,55 +0,0 @@
|
||||
[
|
||||
"1.jpg",
|
||||
"2.jpg",
|
||||
"3.jpg",
|
||||
"4.jpg",
|
||||
"5.jpg",
|
||||
"6.jpg",
|
||||
"7.jpg",
|
||||
"8.png",
|
||||
"9.jpg",
|
||||
"10.jpg",
|
||||
"11.jpg",
|
||||
"12.jpg",
|
||||
"13.jpg",
|
||||
"14.jpg",
|
||||
"15.jpg",
|
||||
"16.jpg",
|
||||
"17.jpg",
|
||||
"18.jpg",
|
||||
"19.jpg",
|
||||
"20.jpg",
|
||||
"21.jpg",
|
||||
"22.jpg",
|
||||
"23.jpg",
|
||||
"24.jpg",
|
||||
"25.jpg",
|
||||
"26.jpg",
|
||||
"27.jpg",
|
||||
"28.jpg",
|
||||
"29.jpg",
|
||||
"30.jpeg",
|
||||
"31.jpg",
|
||||
"32.jpg",
|
||||
"33.jpg",
|
||||
"34.png",
|
||||
"35.jpg",
|
||||
"36.jpg",
|
||||
"37.jpg",
|
||||
"38.jpg",
|
||||
"39.jpg",
|
||||
"40.jpg",
|
||||
"41.jpg",
|
||||
"42.jpg",
|
||||
"43.jpg",
|
||||
"44.jpg",
|
||||
"45.gif",
|
||||
"46.jpg",
|
||||
"47.jpg",
|
||||
"48.jpg",
|
||||
"49.jpg",
|
||||
"50.jpg",
|
||||
"51.jpg",
|
||||
"52.jpg",
|
||||
"53.jpg"
|
||||
]
|
||||
@@ -19,6 +19,6 @@ module.exports = class XiaoCommand extends Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).has('ATTACH_FILES'))
|
||||
return message.say('This Command requires the `Attach Files` Permission.');
|
||||
const xiao = xiaos[Math.floor(Math.random() * xiaos.length)];
|
||||
return message.channel.send({files: [`./images/Xiao${xiao}`]});
|
||||
return message.channel.send({files: [xiao]});
|
||||
}
|
||||
};
|
||||
|
||||
@@ -1,23 +1,23 @@
|
||||
[
|
||||
"1.png",
|
||||
"2.jpg",
|
||||
"3.jpg",
|
||||
"4.jpg",
|
||||
"5.jpg",
|
||||
"6.jpg",
|
||||
"7.jpg",
|
||||
"8.png",
|
||||
"9.png",
|
||||
"10.png",
|
||||
"11.png",
|
||||
"12.png",
|
||||
"13.jpg",
|
||||
"14.jpg",
|
||||
"15.png",
|
||||
"16.jpg",
|
||||
"17.png",
|
||||
"18.gif",
|
||||
"19.png",
|
||||
"20.jpg",
|
||||
"21.jpg"
|
||||
"https://i.imgur.com/tyVciSC.png",
|
||||
"https://i.imgur.com/dTGqFFe.jpg",
|
||||
"https://i.imgur.com/bB1FpdZ.jpg",
|
||||
"https://i.imgur.com/BuO0RHc.jpg",
|
||||
"https://i.imgur.com/oXCxBSe.jpg",
|
||||
"https://i.imgur.com/Wf6Kss3.jpg",
|
||||
"https://i.imgur.com/OiFboDi.jpg",
|
||||
"https://i.imgur.com/3Z56sKT.png",
|
||||
"https://i.imgur.com/rBLuUPT.png",
|
||||
"https://i.imgur.com/XSuTmzl.png",
|
||||
"https://i.imgur.com/sBIo3oF.png",
|
||||
"https://i.imgur.com/dcWMZnv.png",
|
||||
"https://i.imgur.com/nh6kZjH.jpg",
|
||||
"https://i.imgur.com/DbBeMgY.png",
|
||||
"https://i.imgur.com/qaXCHLv.png",
|
||||
"https://i.imgur.com/34itKmU.jpg",
|
||||
"https://i.imgur.com/3pbBjxN.png",
|
||||
"https://i.imgur.com/bKx1XuE.gif",
|
||||
"https://i.imgur.com/iSVUORW.png",
|
||||
"https://i.imgur.com/O2JLT8q.jpg",
|
||||
"https://i.imgur.com/kEAj26f.jpg"
|
||||
]
|
||||
|
||||
Reference in New Issue
Block a user