compareCard()
この関数は、2 人のユーザーを比較する画像を生成するために使用します。
パラメーター
| Parameter | Type | Required | Description |
|---|---|---|---|
| guild | {id: string, name: string} | ✅ | ギルドオブジェクト。 |
| user1 | CardUserOptions | ✅ | 1 人目のユーザー。 |
| user2 | CardUserOptions | ✅ | 2 人目のユーザー。 |
| options | CompareCardOptions | ❌ | オプション。 |
| locales | CompareCardLocales | ❌ | ローカライズ文言。 |
戻り値
- Promise<
{ attachment: Buffer; description: string; name: string; }>
例外
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
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 comparison card object
.catch((err) => console.log(err)); // Returns the error