Giter VIP home page Giter VIP logo

discord-md-badge's Introduction

Discord Profile Markdown badge

Add to your GitHub readme a badge that shows your Discord username and presence, or a server invite!

Set up

The set up process will vary depending on the use:

User account

  1. Join the Discord server (required, as that's where the bot gets your presence information from)

  2. 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)

Server invite

  1. Create an invite for your server, making sure to disable expiration (it will look something like this: https://discord.gg/INVITEID)

  2. Add to the readme

    [![](https://dcbadge.vercel.app/api/server/INVITEID)](https://discord.gg/INVITEID)

    replacing INVITEID with the part of the invite after https://discord.gg/

Done!

Bot account

  1. DM me () your bot's invite link

  2. 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!

Styling

You can chain parameters by connecting them with & (e.g. ?style=flat&theme=clean&compact=true).

style

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 flat ?style=flat
flat-square flat-square ?style=flat-square
for-the-badge (default) for-the-badge None (default)
plastic plastic ?style=plastic
social social ?style=social

theme

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)

Badge Theme Query
default Default None (default)
default-inverted Default inverted ?theme=default-inverted
clean Clean ?theme=clean
clean-inverted Clean inverted ?theme=clean-inverted
dc Discord ?theme=discord
dc-inverted Discord inverted ?theme=discord-inverted
full-presence Full presence ?theme=full-presence
grey Gray ?theme=gray
blurple Blurple ?theme=blurple

Note: the theme option will not work with the social style.

compact

Badge Query
compact ?compact=true

logoColor

You can pass a color for the logo (the examples below also use &theme=default-inverted to show the color better)

Badge Query Description
presence ?logoColor=presence Changes the color of the logo according to the presence
word ?logoColor=pink Supported colors here
hex ?logoColor=ff6b6b Any hex code, without the #

I've added this to my GitHub bio and it doesn't work!

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 (, [email protected])

Endpoints

(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

HTML

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" />

discord-md-badge's People

Contributors

dependabot[bot] avatar gitlimes avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.