Skip to content

Commit 8c02680

Browse files
committed
Add perfeito command
1 parent 1a2818e commit 8c02680

File tree

8 files changed

+87
-6
lines changed

8 files changed

+87
-6
lines changed

.github/workflows/codeql-analysis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
# the `language` matrix defined below to confirm you have the correct set of
1010
# supported CodeQL languages.
1111
#
12-
name: "CodeQL"
12+
name: "Zuly CodeQL Analysis"
1313

1414
on:
1515
push:

.github/workflows/zuly.yml

+1-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
name: zuly
2-
1+
name: Zuly Linter
32
on:
43
push:
54
branches:

assets/images/memes/perfeito.png

53.1 KB
Loading

assets/images/utils/mask.png

2.56 KB
Loading

src/Commands/Fun/PerfeitoCommand.js

+82
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,82 @@
1+
module.exports = class FisheyeCommand {
2+
constructor () {
3+
return {
4+
permissoes: {
5+
membro: [],
6+
bot: ['ATTACH_FILES'],
7+
dono: false
8+
},
9+
pt: {
10+
nome: 'perfeito',
11+
categoria: '⭐ » Diversão',
12+
desc: 'Quando alguém diz nada é perfeito.'
13+
},
14+
en: {
15+
nome: 'perfect',
16+
categoria: '⭐ » Fun',
17+
desc: 'When someone says nothing is perfect.'
18+
},
19+
fr: {
20+
nome: 'parfait',
21+
categoria: '⭐ » Divertissement',
22+
desc: 'Quand quelqu\'un dit que rien n\'est parfait.'
23+
},
24+
/*
25+
SUB_COMMAND 1 = SubCommand
26+
SUB_COMMAND_GROUP: 2 = SubCommandGroup
27+
STRING: 3 = String
28+
INTEGER: 4 = Any integer between -2^53 and 2^53
29+
BOOLEAN: 5 = True or False
30+
USER: 6 = User Mention
31+
CHANNEL: 7 = Includes all channel types + categories
32+
ROLE: 8 = Role Mention
33+
MENTIONABLE: 9 = Includes users and roles
34+
NUMBER: 10 = Any double between -2^53 and 2^53
35+
*/
36+
options: [
37+
{
38+
type: 6,
39+
name: 'user',
40+
description: 'User to make the fisheye of.',
41+
required: true,
42+
name_localizations: {
43+
'pt-BR': 'usuário',
44+
'en-US': 'user',
45+
'fr': 'utilisateur'
46+
},
47+
description_localizations: {
48+
'pt-BR': 'Usuário para dizer que é perfeito.',
49+
'en-US': 'User to say that it is perfect.',
50+
'fr': 'Utilisateur pour dire qu\'il est parfait.'
51+
}
52+
}
53+
],
54+
aliases: [],
55+
run: this.run
56+
};
57+
}
58+
59+
async run (ctx) {
60+
const { createCanvas, loadImage } = require('canvas');
61+
62+
const user = await global.zuly.users.fetch(ctx.args[0]);
63+
64+
const background = await loadImage('./assets/images/memes/perfeito.png');
65+
const canvas = createCanvas(background.width, background.height);
66+
const avatar = await loadImage(user.displayAvatarURL({ dynamic: false, size: 4096, format: 'png' }));
67+
const redondo = await loadImage('./assets/images/utils/mask.png');
68+
const foto = canvas.getContext('2d');
69+
70+
foto.drawImage(background, 0, 0, canvas.width, canvas.height);
71+
foto.drawImage(avatar, 250, 60, 200, 200);
72+
foto.drawImage(redondo, 250, 60, 200, 200);
73+
74+
const { MessageAttachment } = require('discord.js');
75+
const attachment = new MessageAttachment(canvas.toBuffer(), 'fisheye.png');
76+
77+
ctx.message.channel.slashReply({
78+
content: ctx.message.author.mention,
79+
files: [attachment]
80+
});
81+
}
82+
};

src/Commands/Utils/ReportCommand.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ module.exports = class PrintCommand {
3434
NUMBER: 10 = Any double between -2^53 and 2^53
3535
*/
3636
options: [],
37-
aliases: ['av', 'user-avatar', 'ua', 'memberavatar', 'profileavatar'],
37+
aliases: [],
3838
run: this.run
3939
};
4040
}

src/Commands/Utils/ShortCommand.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = class CalcCommand {
5151
}
5252
}
5353
],
54-
aliases: ['av', 'user-avatar', 'ua', 'memberavatar', 'profileavatar'],
54+
aliases: [],
5555
run: this.run
5656
};
5757
}

src/Commands/Utils/UserinfoCommand.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ module.exports = class CalcCommand {
5151
}
5252
}
5353
],
54-
aliases: ['whois', 'ui', 'member', 'memberinfo'],
54+
aliases: [],
5555
run: this.run
5656
};
5757
}

0 commit comments

Comments
 (0)