setXPバージョン: v2.0
目次
setXP()
この関数は、ユーザーの XP を設定するために使用します。
パラメーター
Section titled “パラメーター”| Parameter | Type | Required | Description |
|---|---|---|---|
| userId | string | ✅ | ユーザーの ID。 |
| guildId | string | ✅ | ギルド ID。 |
| xp | number | ✅ | 設定する絶対 XP 値。 |
| username | string | ❌ | ユーザー名。 |
- Promise<
XpResult>
XpFatal- 無効なパラメーターが渡された場合。
[JS] 例
Section titled “[JS] 例”const {setXP} = require('simply-xp');
const userid = "326815959358898189";const guildid = "867999056172052551";const username = "Abadima";const xp = 10000000;
setXP(userid, guildid, xp, username) .then(console.log) // Returns the user object .catch((err) => console.log(err)); // Returns the error