setFlags()
This function is used to set the flags of a user, useful for setting flags like modified
, boosted
, etc...
Currently not functional in the current version, but developers can access them and use them to their advantage,
simply-xp will have plugins to use these flags in the future.
Parametersβ
Parameter | Type | Required | Description |
---|---|---|---|
userId | string | β | The ID of the user. |
guildId | string | β | The guild ID. |
flags | Array | β | The flags to set. |
username | string | β | Username to use if auto_create is enabled. |
Returnsβ
- Promise<
UserResult
>
Throwsβ
XpFatal
- if invalid parameters are provided, or if there is a database error.
[JS] Exampleβ
const {setFlags} = require('simply-xp');
const userid = "326815959358898189";
const guildid = "867999056172052551";
const flags = ["modified", "boosted"];
const username = "Abadima";
setFlags(userid, guildid, flags, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error