mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-16 08:22:22 +02:00
Credit Command
This commit is contained in:
@@ -17,6 +17,12 @@ module.exports = class RipCommand extends Command {
|
||||
duration: 10
|
||||
},
|
||||
clientPermissions: ['ATTACH_FILES'],
|
||||
credit: [
|
||||
{
|
||||
name: 'vician',
|
||||
url: 'https://www.123rf.com/profile_vician'
|
||||
}
|
||||
],
|
||||
args: [
|
||||
{
|
||||
key: 'user',
|
||||
@@ -29,7 +35,7 @@ module.exports = class RipCommand extends Command {
|
||||
}
|
||||
|
||||
async run(msg, { user }) {
|
||||
const avatarURL = user.displayAvatarURL({ format: 'png', size: 256 });
|
||||
const avatarURL = user.displayAvatarURL({ format: 'png', size: 512 });
|
||||
try {
|
||||
const base = await loadImage(path.join(__dirname, '..', '..', 'assets', 'images', 'rip.png'));
|
||||
const { body } = await request.get(avatarURL);
|
||||
@@ -37,8 +43,8 @@ module.exports = class RipCommand extends Command {
|
||||
const canvas = createCanvas(base.width, base.height);
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(base, 0, 0);
|
||||
ctx.drawImage(avatar, 59, 68, 200, 200);
|
||||
greyscale(ctx, 59, 68, 200, 200);
|
||||
ctx.drawImage(avatar, 194, 399, 500, 500);
|
||||
greyscale(ctx, 194, 399, 500, 500);
|
||||
return msg.say({ files: [{ attachment: canvas.toBuffer(), name: 'rip.png' }] });
|
||||
} catch (err) {
|
||||
return msg.reply(`Oh no, an error occurred: \`${err.message}\`. Try again later!`);
|
||||
|
||||
Reference in New Issue
Block a user