rankCard()
この関数は、ユーザーのランク画像を生成するために使用します。
パラメーター
| Parameter | Type | Required | Description |
|---|---|---|---|
| guild | {id: string, name: string} | ✅ | ギルドオブジェクト。 |
| user | CardUserOptions | ✅ | ユーザーオブジェクト。 |
| options | RankCardOptions | ❌ | オプション。 |
| locales | RankCardLocales | ❌ | ローカライズ文言。 |
戻り値
- Promise<
{ attachment: Buffer; description: string; name: string; }>
例外
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
const {rankCard} = require('simply-xp');
const guild = {
id: "867999056172052551",
name: "Simply Develop"
};
const user = {
avatarURL: "https://avatarfiles.alphacoders.com/280/280594.jpg",
id: "326815959358898189",
username: "Abadima",
};
rankCard(guild, user)
.then(console.log) // Returns the rank card object
.catch((err) => console.log(err)); // Returns the error