Your avatar will be added to a suit! It will look cool! Command: <your prefix>av-suit
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
const jimp = require('jimp');
module.exports = async (event, context) => {
if (event.content.startsWith(`${process.env.PREFIX}av-suit`)) {
let member = event.author.id;
if (event.mentions.length >= 1) {
member = event.mentions[0].id;
}
let user = await lib.discord.users['@0.1.4'].retrieve({
user_id: member,
});
let img = await jimp.read(
'https://i.ibb.co/nfy4JGs/Pics-Art-09-12-10-13-13.png'
);
let avatar_jimp = await jimp.read(user.avatar_url);
avatar_jimp.circle();
avatar_jimp.resize(222, 222);
img.composite(avatar_jimp, 200, 200);
let buffer = await img.getBufferAsync(jimp.MIME_PNG);
await lib.discord.channels['@0.1.1'].messages.create({
channel_id: event.channel_id,
content: ``,
filename: 'man.png',
file: buffer,
});
}
};