améliore + command pic

This commit is contained in:
arthur
2024-04-27 23:27:43 +02:00
parent 972d77fdf6
commit 193fe189d5
3 changed files with 58 additions and 55 deletions
+7 -3
View File
@@ -22,13 +22,17 @@ module.exports = {
}
let avatar = user.avatarURL({dynamic : true, size : 1024});
if (user.avatarURL({dynamic : true, size : 1024}) === null) {
return message.reply('L\'utilisateur n\'a pas d\'avatar.');
if (avatar === null && user.discriminator !== '0') {
const index = user.discriminator % 5;
avatar = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
} else if (avatar === null) {
const index = (BigInt(user.id) >> 22n) % 6n;
avatar = `https://cdn.discordapp.com/embed/avatars/${index}.png`;
}
const button = new ButtonBuilder()
.setLabel('Avatar url')
.setURL(user.avatarURL({dynamic : true, size : 1024}))
.setURL(avatar)
.setStyle(ButtonStyle.Link);
const row = new ActionRowBuilder()