addLevelバージョン: v2.0
目次
addLevel()
この関数は、ユーザーにレベルを追加するために使用します。
ユーザーのレベルが実際に変化した場合、この関数は XpEvents の levelUp / levelDown コールバックも発火し、完了まで待機してから解決します。
パラメーター
Section titled “パラメーター”| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | ユーザーの ID。 |
| guildId | string | ✅ | ギルド ID。 |
| level | number | ✅ | 追加するレベル数。 |
| username | string | ❌ | ユーザー名。 |
- Promise<
UserResult>
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
Section titled “[JS] 例”const { addLevel } = require("simply-xp");
const userid = "770551872309166090";const guildid = "867999056172052551";const level = 69;const username = "Rahuletto";
addLevel(userid, guildid, level, username) .then(console.log) // Returns the user object .catch((err) => console.log(err)); // Returns the error