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

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
userIdstringThe ID of the user.
guildIdstringThe guild ID.
flagsArrayString/number flags to store. Use undefined to remove flags.
usernamestringUsername 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