If you've ever used Discord, you've probably noticed the small colored dot next to someone's profile picture. This is called presence, and it shows a user's current status on Discord.
For most users, it's just a way to tell if someone is online. For developers, however, presence data can be extremely useful.
Discord currently has four main presence states:
| Status | Meaning |
|---|---|
| Online | The user is active on Discord |
| Idle | The user is away or inactive |
| Do Not Disturb | Notifications are muted |
| Offline | The user is not connected |
These statuses are typically represented with colored indicators:
Presence becomes interesting when you start building tools around Discord.
For example, developers often use presence data to:
A popular API that provides this data is Lanyard, which makes Discord presence accessible through a simple API and WebSocket connection.
fetch("https://api.lanyard.rest/v1/users/USER_ID")
.then(res => res.json())
.then(data => {
console.log(data.data.discord_status);
});
The response might look something like:
{
"discord_status": "online"
}
This allows you to easily show something like:
Status: Online
on your website.
While HTTP APIs work well, presence is most useful when it updates instantly.
Many presence APIs support WebSockets, which allow your application to receive updates whenever a user's status changes.
This means you can build things like:
Without needing to constantly poll the API.
[!TIP] If you're building a personal site, adding your Discord presence can make the page feel more alive. It gives visitors a quick way to see if you're currently online or working on something.
Here's a minimal example of how presence might appear on a website:
SimplySnox
Status: Online
Playing: Visual Studio Code
Small details like this can make personal sites feel much more dynamic.
Discord presence is a small feature that becomes surprisingly powerful when developers start using it creatively.
Whether you're building a portfolio, dashboard, or Discord bot, presence data can add a nice touch of real-time interaction to your projects.
And the best part? It's incredibly easy to integrate.
If you're curious about how this website shows Discord presence, you can check the source code on GitHub.