Skip to main content

๐Ÿ™Œ Persences

Status & activities updates of users and bots

๐Ÿค” "Presence"โ€‹

Presence is an object with several data and methods, you should read discord.js documentation to see how to work with Presence.

We will handle PresenceUpdate so you can also take a look at this page:

๐Ÿ†™ PresenceUpdateโ€‹

Has two arguments old_presence and new_presence who are instances of Presence.

โš ๏ธ Warning: old_presence is the user status before the update and new_presence after the update.

export async function parse(old_presence, new_presence)
{
console.log(`${new_presence.member.user.username}'s status changed`)
}

export const conditions = [];
export const any_guild = false;
export const allow_bots = false;

โŽฏ Exports

At the bottom of the file we have exports, which includes several important elements.

export const conditions = [];
export const any_guild = false;
export const allow_bots = false;
  • parse โ†’ method to handle the event
  • any_guild โ†’ if false, the command can be executed only on the main guild
  • allow_bots โ†’ if false, it will ignore events when the user is a bot