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
Step 1: Join the Lanyard Discord server at discord.gg/lanyard (required for presence tracking).
- 2
Step 2: Enable Developer Mode in Discord (Settings → Advanced → Developer Mode).
- 3
Step 3: Right-click your username in Discord and copy your user ID (18-digit number).
- 4
Step 4: Add to your README: [](https://discord.com/users/YOUR_DISCORD_USER_ID)
- 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:
- Join the Lanyard Discord server at discord.gg/lanyard. This is required — Lanyard only tracks members of its server.
- In your Discord settings, ensure your activity status is visible (not hidden in privacy settings).
- Find your Discord user ID: in Discord, enable Developer Mode under Settings → Advanced, then right-click your username and 'Copy ID'.
- Add to your README:
[](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:darkorlighthideDiscrim: Set totrueto hide the discriminator (#XXXX portion) if your account uses a legacy username formatborderRadius: Set a pixel value (e.g.,10px) to control card corner roundingbg: Background color hex (without#)animated: Set tofalseto disable the pulsing animation on the status indicatorshowDisplayName: Set totrueto show your display name instead of usernameidleMessage: 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: `[](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
- Complete Guide to GitHub Badges for Your README
Learn how to add shields.io badges, GitHub stats cards, and tool badges to your GitHub profile README. Includes ready-to-use code for 50+ popular technologies.
- Best GitHub README Widgets and Tools: The Complete 2026 List
A curated list of the best GitHub profile README widgets — from snake animations to Spotify players, stats cards to 3D contribution graphs. Includes setup instructions for each.
- How to Add GitHub Stats Cards to Your README (2026 Guide)
Step-by-step guide to adding GitHub stats cards, language cards, streak stats, and WakaTime cards to your GitHub profile README using github-readme-stats.
Generate Your GitHub Profile README
Generate a GitHub profile README featuring Discord Presence with AI
Try It Free — No Sign UpMore Widget Guides
How to Add Spotify Now Playing
Step-by-step guide to adding Spotify Now Playing to your GitHub README
How to Add WakaTime Coding Stats
Step-by-step guide to adding WakaTime Coding Stats to your GitHub README
How to Add Snake Contribution Animation
Step-by-step guide to adding Snake Contribution Animation to your GitHub README
How to Add Profile Views Counter
Step-by-step guide to adding Profile Views Counter to your GitHub README
How to Add Typing SVG Animation
Step-by-step guide to adding Typing SVG Animation to your GitHub README
How to Add GitHub Streak Stats
Step-by-step guide to adding GitHub Streak Stats to your GitHub README