rankVersion: v1.3
目次
rank()
このコンテンツはまだ日本語訳がありません。
This function is used to generate an image of a user’s rank.
Parameters
Section titled “Parameters”| Parameter | Type | Required | Description |
|---|---|---|---|
| message | Message | ✅ | The message object. |
| userId | string | ✅ | The ID of the user. |
| guildId | string | ✅ | The guild ID. |
| options | RankCardOptions | ❌ | The options. |
Returns Promise<<MessageAttachment>>
Section titled “Returns Promise<<MessageAttachment>>”
Throws
Section titled “Throws”new Error()- if invalid parameters are provided, or we are unable to fetch the user’s avatar.
[JS] Example
Section titled “[JS] Example”const { rank } = require("simply-xp");
const userId = "326815959358898189";const guildId = "867999056172052551";
rank(message, userId, guildId) .then(console.log) // Returns the rank card object .catch((err) => console.log(err)); // Returns the errorRank Options
Section titled “Rank Options”| Option | Type | Required | Description |
|---|---|---|---|
| background | URL | ❌ | The background image. |
| color | HEX | ❌ | The color. |