updateOptionsバージョン: v2.0
目次
updateOptions()
この関数は、XP Client のオプションを更新するために使用します。
xp_rate を指定する場合は、"slow"、"normal"、"fast" のいずれか、または 0 より大きい有限数である必要があります。
パラメーター
Section titled “パラメーター”| Parameter | Type | Required | Description |
|---|---|---|---|
| clientOptions | NewClientOptions | ✅ | 更新するオプション。 |
Promise<void>
XpFatal- 無効なパラメーターが渡された場合、または無効なデータベース接続が渡された場合。
[JS] 例
Section titled “[JS] 例”const { updateOptions } = require("simply-xp");
(async () => { await updateOptions({ xp_rate: "fast" }); // Returns Promise<void>
await updateOptions({ dbOptions: { type: "mongodb", database: mongoClient, name: "my-custom-db", }, });})();