Skip to main content

compareCard()

This function is used to generate an image of a user's rank.

Parameters​

ParameterTypeRequiredDescription
guild{id: string, name: string}βœ…The guild object.
user1CardUserOptionsβœ…The first user's object
user2CardUserOptionsβœ…The second user's object
optionsRankCardOptions❌The options.
localesRankCardLocales❌The locales.

Returns​

  • Promise<{ attachment: Buffer; description: string; name: string; }>

Throws​

  • XpFatal - if invalid parameters are provided.

[JS] Example​

const {compareCard} = require('simply-xp');

const guild = {
id: "867999056172052551",
name: "Simply Develop"
};

const user1 = {
avatarURL: "https://avatarfiles.alphacoders.com/280/280594.jpg",
id: "326815959358898189",
username: "Abadima",
};

const user2 = {
avatarURL: "https://rahuletto.thedev.id/assets/logo.webp",
id: "770551872309166090",
username: "Rahuletto",
};

compareCard(guild, user1, user2)
.then(console.log) // Returns the rank card object
.catch((err) => console.log(err)); // Returns the error