Skip to main content
Version: v2.0

setFlags()

This function stores flags on a user record.

Flags are persisted in the user data and can be consumed by your own logic or plugins. Pass undefined to remove all stored flags from the user.

Parameters​

ParameterTypeRequiredDescription
userIdstringβœ…The ID of the user.
guildIdstringβœ…The guild ID.
flagsArray❌String/number flags to store. Use undefined to remove flags.
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", "illegal"];
const username = "Abadima";

setFlags(userid, guildid, flags, username)
.then(console.log) // Returns the user object
.catch((err) => console.log(err)); // Returns the error