Skip to content

Commit

Permalink
Add perfeito command
Browse files Browse the repository at this point in the history
  • Loading branch information
euandrelucas committed May 11, 2022
1 parent 1a2818e commit 8c02680
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"
name: "Zuly CodeQL Analysis"

on:
push:
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/zuly.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
name: zuly

name: Zuly Linter
on:
push:
branches:
Expand Down
Binary file added assets/images/memes/perfeito.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added assets/images/utils/mask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
82 changes: 82 additions & 0 deletions src/Commands/Fun/PerfeitoCommand.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
module.exports = class FisheyeCommand {
constructor () {
return {
permissoes: {
membro: [],
bot: ['ATTACH_FILES'],
dono: false
},
pt: {
nome: 'perfeito',
categoria: '⭐ » Diversão',
desc: 'Quando alguém diz nada é perfeito.'
},
en: {
nome: 'perfect',
categoria: '⭐ » Fun',
desc: 'When someone says nothing is perfect.'
},
fr: {
nome: 'parfait',
categoria: '⭐ » Divertissement',
desc: 'Quand quelqu\'un dit que rien n\'est parfait.'
},
/*
SUB_COMMAND 1 = SubCommand
SUB_COMMAND_GROUP: 2 = SubCommandGroup
STRING: 3 = String
INTEGER: 4 = Any integer between -2^53 and 2^53
BOOLEAN: 5 = True or False
USER: 6 = User Mention
CHANNEL: 7 = Includes all channel types + categories
ROLE: 8 = Role Mention
MENTIONABLE: 9 = Includes users and roles
NUMBER: 10 = Any double between -2^53 and 2^53
*/
options: [
{
type: 6,
name: 'user',
description: 'User to make the fisheye of.',
required: true,
name_localizations: {
'pt-BR': 'usuário',
'en-US': 'user',
'fr': 'utilisateur'
},
description_localizations: {
'pt-BR': 'Usuário para dizer que é perfeito.',
'en-US': 'User to say that it is perfect.',
'fr': 'Utilisateur pour dire qu\'il est parfait.'
}
}
],
aliases: [],
run: this.run
};
}

async run (ctx) {
const { createCanvas, loadImage } = require('canvas');

const user = await global.zuly.users.fetch(ctx.args[0]);

const background = await loadImage('./assets/images/memes/perfeito.png');
const canvas = createCanvas(background.width, background.height);
const avatar = await loadImage(user.displayAvatarURL({ dynamic: false, size: 4096, format: 'png' }));
const redondo = await loadImage('./assets/images/utils/mask.png');
const foto = canvas.getContext('2d');

foto.drawImage(background, 0, 0, canvas.width, canvas.height);
foto.drawImage(avatar, 250, 60, 200, 200);
foto.drawImage(redondo, 250, 60, 200, 200);

const { MessageAttachment } = require('discord.js');
const attachment = new MessageAttachment(canvas.toBuffer(), 'fisheye.png');

ctx.message.channel.slashReply({
content: ctx.message.author.mention,
files: [attachment]
});
}
};
2 changes: 1 addition & 1 deletion src/Commands/Utils/ReportCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ module.exports = class PrintCommand {
NUMBER: 10 = Any double between -2^53 and 2^53
*/
options: [],
aliases: ['av', 'user-avatar', 'ua', 'memberavatar', 'profileavatar'],
aliases: [],
run: this.run
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Utils/ShortCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = class CalcCommand {
}
}
],
aliases: ['av', 'user-avatar', 'ua', 'memberavatar', 'profileavatar'],
aliases: [],
run: this.run
};
}
Expand Down
2 changes: 1 addition & 1 deletion src/Commands/Utils/UserinfoCommand.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ module.exports = class CalcCommand {
}
}
],
aliases: ['whois', 'ui', 'member', 'memberinfo'],
aliases: [],
run: this.run
};
}
Expand Down

0 comments on commit 8c02680

Please sign in to comment.