Add to your GitHub readme a badge that shows your Discord username and presence, or a server invite!
The set up process will vary depending on the use:
-
Join the Discord server (required, as that's where the bot gets your presence information from)
-
Add to the readme
![](https://dcbadge.vercel.app/api/shield/USERID)
replacing
USERID
with your Discord user ID (e.g.![](https://dcbadge.vercel.app/api/shield/406125028065804289)
)
Done! (Make sure not to leave the server, or this will break)
-
Create an invite for your server, making sure to disable expiration (it will look something like this:
https://discord.gg/INVITEID
) -
Add to the readme
[![](https://dcbadge.vercel.app/api/server/INVITEID)](https://discord.gg/INVITEID)
replacing
INVITEID
with the part of the invite afterhttps://discord.gg/
Done!
-
Add to the readme
![](https://dcbadge.vercel.app/api/shield/BOTID?bot=true)
replacing
BOTID
with your Discord bot's user ID (e.g.![](https://dcbadge.vercel.app/api/shield/852977967776399400?bot=true)
)
Done!
You can chain parameters by connecting them with &
(e.g. ?style=flat&theme=clean&compact=true
).
This uses shields.io to generate the badge, so you can choose one of the styles from there by appending ?style=
to the url.
Badge | Style | Query |
---|---|---|
flat | ?style=flat |
|
flat-square | ?style=flat-square |
|
for-the-badge | None (default) | |
plastic | ?style=plastic |
|
social | ?style=social |
You can also use the theme
query option to change the colors of the shield
In the following themes the green color gets replaced by the color corresponding to your presence (green, yellow, red, and grey, for online, idle, do not disturb, and offline, respectively)
Note: the theme
option will not work with the social style
.
Badge | Query |
---|---|
?compact=true |
You can pass a color for the logo (the examples below also use &theme=default-inverted
to show the color better)
Badge | Query | Description |
---|---|---|
?logoColor=presence |
Changes the color of the logo according to the presence | |
?logoColor=pink |
Supported colors here | |
?logoColor=ff6b6b |
Any hex code, without the # |
This won't work in bios, only in profile readmes (and any other part of GitHub that supports markdown). Here's some info on what a profile readme is and how to set it up.
For any questions feel free to contact me (, mdbadge@ashm.dev)
(Preceded by https://dcbadge.vercel.app/api/shield
)
Endpoint | Description | Example response |
---|---|---|
/USERID |
returns a shield in the SVG format | |
/json/USERID |
returns the raw JSON used to generate the shields | { "t": "monty#9398", "p": "online" } |
The above endpoints are also valid for bots, by adding the ?bot=true
query parameter
The API returns an SVG image, so you can embed it in your html just like you would with a regular image by doing
<img src="https://dcbadge.vercel.app/api/shield/USERID" />