メインコンテンツまでスキップ

updateOptions()

This function is used to update XP Client options.

If provided, xp_rate must be "slow", "normal", "fast", or a finite number greater than 0.

備考

For MongoDB, you can pass dbOptions.name to explicitly set the database name used by internal operations.

Parameters

ParameterTypeRequiredDescription
clientOptionsNewClientOptionsThe options to update.

Returns

  • Promise<void>

Throws

  • XpFatal - if invalid parameters are provided, or invalid database connection is provided.

[JS] Example

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",
},
});
})();