Skip to main content

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​

ParameterTypeRequiredDescription
userIdstringβœ…The ID of the user.
guildIdstringβœ…The guild ID.
flagsArrayβœ…The flags to set.
usernamestring❌Username to use if auto_create is enabled.

Returns​

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