...
const getMemberTotalKarma = async (memberDiscordId, interaction) => {
try {
...
if (gradationValue && gradationRole) {
await interaction.deferReply({
fetchReply: true,
deferReply: true,
})
...
const rank = new canvacord.Rank()
.setAvatar(img)
.setCurrentXP(karma)
.setRequiredXP(karmaNeededForNextRole)
.setProgressBar("#e523ff")
.setUsername(memberDiscordId.user.username)
.renderEmojis(true)
.setRank(karma, "kR", true)
rank.build()
.then(async buffer => {
const attachment = new AttachmentBuilder(buffer, { name: 'rank.png' })
return new EmbedBuilder()
.setColor(colors.primary)
.setDescription(`meow`)
.setImage(`attachment://${attachment.name}`);
});
}
return new EmbedBuilder().setColor(colors.primary).setDescription(`meow2`);
} catch (error) {
console.log(error);
return new EmbedBuilder().setColor(colors.danger).setDescription(`error`);
}
}
...
...
const getMemberTotalKarma = async (memberDiscordId, interaction) => {
try {
...
if (gradationValue && gradationRole) {
await interaction.deferReply({
fetchReply: true,
deferReply: true,
})
...
const rank = new canvacord.Rank()
.setAvatar(img)
.setCurrentXP(karma)
.setRequiredXP(karmaNeededForNextRole)
.setProgressBar("#e523ff")
.setUsername(memberDiscordId.user.username)
.renderEmojis(true)
.setRank(karma, "kR", true)
rank.build()
.then(async buffer => {
const attachment = new AttachmentBuilder(buffer, { name: 'rank.png' })
return new EmbedBuilder()
.setColor(colors.primary)
.setDescription(`meow`)
.setImage(`attachment://${attachment.name}`);
});
}
return new EmbedBuilder().setColor(colors.primary).setDescription(`meow2`);
} catch (error) {
console.log(error);
return new EmbedBuilder().setColor(colors.danger).setDescription(`error`);
}
}
...