README Generator

How to Add Discord Presence to Your GitHub Profile README

Displaying your Discord status on your GitHub profile shows visitors whether you are currently online, what you are listening to or playing, and how to reach you on Discord. For developers who are active in Discord communities or open source servers, this adds a real-time social signal to an otherwise static profile. This guide covers the cnrad/lanyard-profile-readme widget, which uses the Lanyard API to display your live Discord presence status as a styled badge.

Quick Setup Steps

  1. 1

    Step 1: Join the Lanyard Discord server at discord.gg/lanyard (required for presence tracking).

  2. 2

    Step 2: Enable Developer Mode in Discord (Settings → Advanced → Developer Mode).

  3. 3

    Step 3: Right-click your username in Discord and copy your user ID (18-digit number).

  4. 4

    Step 4: Add to your README: [![Discord](https://lanyard.cnrad.dev/api/YOUR_DISCORD_USER_ID)](https://discord.com/users/YOUR_DISCORD_USER_ID)

  5. 5

    Step 5: Commit and push. Visit your profile to verify your current Discord status renders correctly.

What Is the Discord Presence Widget?

The lanyard-profile-readme widget connects to Lanyard — an open-source service that exposes your Discord presence via a public API. When you join the Lanyard Discord server, your status, currently playing game, and Spotify activity become available through the API. The GitHub widget then displays this data as a live badge on your profile README.

The widget shows: your current online/idle/do-not-disturb/offline status, the game or application you are currently using, and your Spotify track if Discord is detecting it. The badge updates in real time each time your profile is loaded, giving visitors a true snapshot of your current activity.

How to Set Up Discord Presence

Follow these steps:

  1. Join the Lanyard Discord server at discord.gg/lanyard. This is required — Lanyard only tracks members of its server.
  2. In your Discord settings, ensure your activity status is visible (not hidden in privacy settings).
  3. Find your Discord user ID: in Discord, enable Developer Mode under Settings → Advanced, then right-click your username and 'Copy ID'.
  4. Add to your README:
[![Discord Presence](https://lanyard.cnrad.dev/api/YOUR_DISCORD_USER_ID)](https://discord.com/users/YOUR_DISCORD_USER_ID)

Replace YOUR_DISCORD_USER_ID with your numeric Discord user ID (18-digit number). The badge updates automatically — no GitHub Action or periodic job needed.

Customizing Discord Presence

The lanyard-profile-readme service supports URL parameters for customization:

  • theme: dark or light
  • hideDiscrim: Set to true to hide the discriminator (#XXXX portion) if your account uses a legacy username format
  • borderRadius: Set a pixel value (e.g., 10px) to control card corner rounding
  • bg: Background color hex (without #)
  • animated: Set to false to disable the pulsing animation on the status indicator
  • showDisplayName: Set to true to show your display name instead of username
  • idleMessage: Custom message shown when you are offline (e.g., idleMessage=Not+Online+Right+Now)

Link the badge to your Discord profile URL so visitors can add you or see your server memberships.

Troubleshooting Discord Presence

If the badge shows 'User not found' or fails to load, verify that you have joined the Lanyard Discord server — this is a hard requirement. Lanyard only tracks Discord presence for members of its own server. If you left the server, the API stops returning your data.

If the badge shows as offline even when you are online, check your Discord privacy settings under Settings → Privacy & Safety → Activity Status. If 'Display current activity as a status message' is disabled, Lanyard cannot detect your presence.

If the badge renders but the Discord user ID appears incorrect, re-copy your ID from Discord with Developer Mode enabled. Discord user IDs are 17-19 digit numbers; any shorter number is wrong.

Frequently Asked Questions

How do I add Discord presence to my GitHub README?

Join the Lanyard Discord server at discord.gg/lanyard, find your Discord user ID (enable Developer Mode in Discord settings, then right-click your name), and add: `[![Discord](https://lanyard.cnrad.dev/api/YOUR_DISCORD_USER_ID)](https://discord.com/users/YOUR_DISCORD_USER_ID)` to your README.

Is the Discord presence widget free?

Yes. The cnrad/lanyard-profile-readme project and the Lanyard service itself are both free and open source. Joining the Lanyard Discord server is the only requirement — no API key or paid service is needed.

Why is my Discord status showing as offline?

Common causes: (1) you are not a member of the Lanyard Discord server (required), (2) your Discord activity status is hidden in privacy settings, (3) Discord is not running or is in invisible mode. Verify all three before troubleshooting the widget itself.

Does the Discord presence widget show my real-time status?

Yes. The widget pulls from Lanyard's API on each page load, reflecting your current Discord status at the time the page is rendered. GitHub may cache the badge image for a few minutes, but visitors who hard-refresh or open in a new session will see your actual current status.

From Our Blog

Generate Your GitHub Profile README

Generate a GitHub profile README featuring Discord Presence with AI

Try It Free — No Sign Up