npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

discord.js-presence

v1.1.2

Published

Some discord.js presence toolset, and lightweight. Good for beginners.

Readme

📅 Update scheduled!

An update is scheduled sometime to support activities and statuses in cycles. This might be major, but I don't know yet.

🔁 Are you confused or too lazy to make a cycling presence in discord.js? Me too!

Welcome to the discord.js-presence package, a lightweight toolset for easily creating statuses, cycling statuses, and others in discord.js. Disclaimer that I do not own discord.js as a whole. This uses a modular format similar to discord.js.

I created this tool for my own project and wanted to share it with other people who might want it for creating statuses and managing presences, easily.

I think you can both use import and require for this package, but I'm more of a require guy.

🤔 So... how do you use it?

You use the discord.js-presence package by using functions in the package, which you can use in .js files, like this.

const PresenceManager = require('discord.js-presence');
const PresenceToolkit = new PresenceManager();

client.once(Events.ClientReady, newClient => {
    PresenceToolkit.setStatus(newClient, 'online');
});

Before starting, to make the invisible and dnd presences more compatible, you will need to add GatewayIntentBits.GuildPresences to your intents.

Pretty simple, right? We'll go over what each function and variable does next. Disclaimer that all functions are marked as async. There are a whopping 12 functions for purely presences in this package, so look around for them!

Variables

Functions

  • setStatus

Rundown

Arguments: client*, status*

The setStatus() function sets the status of the bot only limited to these options: idle, dnd, online, invisible.

⚠️ Your bot may become rate limited if you change the status too fast.

Example

PresenceToolkit.setStatus(newClient, 'dnd')

output.png

  • setActivity

Rundown

Arguments: client*, description*, type*

The setActivity() function statically sets the activity of the bot. The argument description sets the activity text to what you want it to be. type accepts any Enum of ActivityType, the most common being ActivityType.Playing.

⚠️ It can be considered dangerous if the activity is changing less than a span of 10/20 seconds.

Example

PresenceToolkit.setActivity(client, 'over every person', ActivityType.Watching)

output.png

  • registerActivities

Rundown

Arguments: client*, activities*

The registerActivity() function 'registers' an activity to a cycle. It accepts an array of activities to cycle through in one go. It will eventually support both statuses and activities.

⚡ Getting deprecated from ~~registerActivities~~ to registerProfiles later.

Example

PresenceToolkit.registerActivities(newClient, [
	{ description: 'discord.js', type: ActivityType.Playing }, // Playing **discord.js**
	{ description: 'music', type: ActivityType.Listening }, // Listening to **music**
	{ description: 'a game', type: ActivityType.Competing }, // Competing in **a game**
]);
  • setPlaceholderActivity

Rundown

Arguments: description*, type*

The setPlaceholderActivity() function overrides the default placeholder status if cycling statuses are stopped. (Or no status is specified?)

Example

PresenceToolkit.setPlaceholderActivity(newClient, 'nothing, really', ActivityType.Playing);

gifdemo.gif

  • unregisterActivities

Rundown

Arguments: client*, activities*

The unregisterActivities() function 'unregisters' an activity from the registerActivities() function. You can specify the number index starting from index [0], or find an activity with a description by turning it into a string. Either way, it unregisters the activity if it was found.

⚡ Getting deprecated from ~~unregisterActivities~~ to unregisterProfiles later.

Example

✅ PresenceToolkit.unregisterActivities(newClient, [0, 1, 2]);
✅ PresenceToolkit.unregisterActivities(newClient, ['Some activity to find', 'Some other activity to find']);
⛔ PresenceToolkit.unregisterActivities(newClient, ['Some activity to find', 0, 1, 'This will not work']);
  • changeCyclingSpeed

Rundown

Arguments: client*, speed*

The changeCyclingSpeed() function changes the cycling speed. There are ratelimits.

Example

⛔ PresenceToolkit.changeCyclingSpeed(newClient, 5);
✅⚠️ PresenceToolkit.changeCyclingSpeed(newClient, 7);
✅ PresenceToolkit.changeCyclingSpeed(newClient, 10);
  • startCycling

Rundown

Arguments: client*

The startCycling() function starts cycling through registered activities/presences.

Example

PresenceToolkit.registerActivities(newClient, [
	{ description: '1', type: ActivityType.Watching },
	{ description: '2', type: ActivityType.Listening },
	{ description: '3', type: ActivityType.Competing },
	{ description: '4', type: ActivityType.Playing },
]);

PresenceToolkit.startCycling(newClient);

result.gif

  • stopCycling

Rundown

Arguments: client*

The stopCycling() function is almost identical to the startCycling() function, but it kills the cycle immediately instead, and it doesn't check whether it's going or not.

Example

PresenceToolkit.stopCycling(newClient);
  • restartCyclingLoop

Rundown

Arguments: client*

The restartCyclingLoop() function is not needed and not a main part, but it forcefully immediately restarts the cycle in case you need it.

Example

PresenceToolkit.restartCyclingLoop(newClient);
  • cycleActivity

Rundown

Arguments: client*

The cycleActivity() function is generally only needed in the main script, not anywhere else. Mostly useless, just controls the cycle.

Example

PresenceToolkit.cycleActivity(newClient);
  • setPlaceholderEnabled

Rundown

Arguments: client*, bool*

The setPlaceholderEnabled() function controls on whether the placeholder status is enabled or not.

Example

PresenceToolkit.setPlaceholderEnabled(newClient, true);
PresenceToolkit.setPlaceholderEnabled(newClient, false);
  • clearActivity

Rundown

Arguments: client*

The clearActivity() function immediately clears the activity, but does not ignore the cycle.

Example

PresenceToolkit.setActivity(client, 'a secret', ActivityType.Watching)
PresenceToolkit.clearActivity(newClient);

👋 Thanks for reading!

Thank you for reading (or scrolling to the end brainlessly) and goodbye! I hope you enjoy this package and find out lots of cool stuff here, as well as at discord.js!