mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-20 14:00:22 +02:00
The Power of const
This commit is contained in:
@@ -25,14 +25,14 @@ module.exports = class YearsCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let user = args.user;
|
||||
const user = args.user;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace(".jpg", ".png");
|
||||
userAvatar = userAvatar.replace(".gif", ".png");
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read("./images/3000years.png"));
|
||||
let [avatar, years] = await Promise.all(images);
|
||||
const [avatar, years] = await Promise.all(images);
|
||||
avatar.resize(200, 200);
|
||||
years.blit(avatar, 461, 127);
|
||||
years.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
|
||||
@@ -25,14 +25,14 @@ module.exports = class BeautifulCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let user = args.user;
|
||||
const user = args.user;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace(".jpg", ".png");
|
||||
userAvatar = userAvatar.replace(".gif", ".png");
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read("./images/beautiful.jpg"));
|
||||
let [avatar, beautiful] = await Promise.all(images);
|
||||
const [avatar, beautiful] = await Promise.all(images);
|
||||
avatar.resize(200, 200);
|
||||
beautiful.blit(avatar, 432, 42);
|
||||
avatar.resize(190, 190);
|
||||
|
||||
@@ -26,7 +26,7 @@ module.exports = class BobRossCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let user = args.user;
|
||||
const user = args.user;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace(".jpg", ".png");
|
||||
userAvatar = userAvatar.replace(".gif", ".png");
|
||||
@@ -34,7 +34,7 @@ module.exports = class BobRossCommand extends commando.Command {
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read("./images/BobRoss.png"));
|
||||
images.push(Jimp.read("./images/BlankWhite.png"));
|
||||
let [avatar, bob, nothing] = await Promise.all(images);
|
||||
const [avatar, bob, nothing] = await Promise.all(images);
|
||||
avatar.rotate(2);
|
||||
avatar.resize(300, 300);
|
||||
nothing.composite(avatar, 44, 85);
|
||||
|
||||
@@ -26,14 +26,14 @@ module.exports = class RIPCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let user = args.user;
|
||||
const user = args.user;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace(".jpg", ".png");
|
||||
userAvatar = userAvatar.replace(".gif", ".png");
|
||||
let images = [];
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read("./images/gravestone.jpg"));
|
||||
let [avatar, gravestone] = await Promise.all(images);
|
||||
const [avatar, gravestone] = await Promise.all(images);
|
||||
avatar.resize(200, 200);
|
||||
gravestone.blit(avatar, 60, 65);
|
||||
gravestone.getBuffer(Jimp.MIME_PNG, (err, buff) => {
|
||||
|
||||
@@ -26,8 +26,8 @@ module.exports = class SteamCardCommand extends commando.Command {
|
||||
if (!message.channel.permissionsFor(this.client.user).hasPermission(['SEND_MESSAGES', 'READ_MESSAGES', 'ATTACH_FILES'])) return;
|
||||
}
|
||||
console.log(`[Command] ${message.content}`);
|
||||
let user = args.user;
|
||||
let userDisplayName = message.guild.member(args.user).displayName;
|
||||
const user = args.user;
|
||||
const userDisplayName = message.guild.member(args.user).displayName;
|
||||
let userAvatar = user.displayAvatarURL;
|
||||
userAvatar = userAvatar.replace(".jpg", ".png");
|
||||
userAvatar = userAvatar.replace(".gif", ".png");
|
||||
@@ -35,8 +35,8 @@ module.exports = class SteamCardCommand extends commando.Command {
|
||||
images.push(Jimp.read(userAvatar));
|
||||
images.push(Jimp.read("./images/SteamCard.png"));
|
||||
images.push(Jimp.read("./images/SteamCardBlank.png"));
|
||||
let [avatar, steamcard, nothing] = await Promise.all(images);
|
||||
let font = await Jimp.loadFont(Jimp.FONT_SANS_32_WHITE);
|
||||
const [avatar, steamcard, nothing] = await Promise.all(images);
|
||||
const font = await Jimp.loadFont(Jimp.FONT_SANS_32_WHITE);
|
||||
avatar.resize(450, 450);
|
||||
nothing.composite(avatar, 25, 25);
|
||||
nothing.composite(steamcard, 0, 0);
|
||||
|
||||
Reference in New Issue
Block a user