GithubHelp home page GithubHelp logo

igorkowalczyk / discord-activity Goto Github PK

View Code? Open in Web Editor NEW
8.0 1.0 1.0 317 KB

๐ŸŽฎ Deno API for displaying Discord activity data in JSON or SVG

Home Page: https://discord-activity.deno.dev

License: MIT License

TypeScript 100.00%
activity api discord deno

discord-activity's Introduction

Discord Activity


๐Ÿฆ• This is a Deno runtime application that generates Discord profile cards, presenting users' activity and presence. Using the Discord API via the Discordeno library, the app serves user cards in SVG format.

๐Ÿ“ท How it looks

Example image

Important

Current Nitro & Boosting badges do not work due to Discord API limitations, unless you currently have an animated avatar then the Nitro badge will be displayed correctly.

โœจ Features

  • โœ… Generate user cards with user presence and activities.
  • ๐ŸŽจ Customize user card appearance by providing query parameters.
  • ๐ŸŒ RESTful API to fetch user data and generate user cards.
  • ๐Ÿš€ Error handling for various scenarios.
  • ๐Ÿ”’ No data tracking and no database required.

๐Ÿš€ Getting Started

Join our Discord Server, without this you will not be able to use the website, Discord bot have to watch your profile and activities for this to work.

Important

If you leave the Discord server, the bot will no longer be able to watch your profile and activities, so the user card will not be generated.

Then, in your browser, go to https://discord-activity.deno.dev/api/:userId and replace :userId with your Discord user ID.

You will be shown a user card with your presence and activities. If you want to customize the appearance of the user card, you can do so by providing query parameters to the URL which are described in the Customizations section.

Note

If you don't know your Discord user ID, go to your Discord settings, then to the "Advanced" tab, scroll down and enable "Developer Mode". Then right-click on your profile and click "Copy ID".

You can also get raw user data in JSON format by going to https://discord-activity.deno.dev/api/raw/:userId and replacing :userId with your Discord user ID.

๐Ÿ“š API Endpoints

  • /api/:userId: Generate a user card image with customizable appearance.
  • /api/raw/:userId: Get raw user data in JSON format.
  • /badges/:badge: Get a Discord badge image by name.

๐ŸŽจ Customizations

Note

You can customize the appearance of the user card by providing query parameters to the /api/:userId endpoint.

Parameter Description Default
bgColor Background color of the user card. #161a23
borderRadius Border radius of the user card. 10
idleMessage Message to display when the user is idle. There is nothing going on here!
hideStatus Hide the status of the user. false

Warning

The bgColor parameter must be a hexadecimal color code without the # symbol. For example, #161a23 should be 161a23.

๐Ÿš€ Example

URL

GET https://discord-activity.deno.dev/api/544164729354977282?bgColor=1b1c1e&borderRadius=0&idleMessage=I'm not doing anything&hideStatus=true

Query Parameters

bgColor: "1b1c1e"
borderRadius: 0
idleMessage: "I'm not doing anything"
hideStatus: true

Result

Generated Image

๐Ÿ”ฉ Self Hosting

  1. Clone this repository git clone https://github.com/IgorKowalczyk/discord-activity
  2. Fill environment variables in the .env file (see Environment Variables)
  3. Run deno task dev to start the project in development mode or deno task start to run the project in production mode.
  4. Visit http://localhost:8080 in your browser

Note

Deno will automatically install all the project packages on the first run

๐Ÿ”ฉ Hosting with Deno Deploy

  1. Fork this repository
  2. Create a new project on Deno Deploy
  3. Connect your forked repository to the project
  4. Click on the Deploy button
  5. Fill environment variables in the project settings (see Environment Variables)
  6. Visit the generated URL in your browser

๐Ÿ“ Environment Variables

Variable Description Default Required
TOKEN Discord Bot Token from the Discord Developer Portal. โœ…
PORT Port on which the application will be running. 3000 โŒ

Note

You can see the .env.example file for an example of how to fill in the environment variables.

Warning

In Deno Deploy, the PORT variable is not required, because the port is assigned automatically!

โ‰๏ธ Issues

If you come across any errors or have suggestions for improvements, please create a new issue here and describe it clearly.

๐Ÿ“ฅ Pull Requests

When submitting a pull request, please follow these steps:

  • Clone this repository https://github.com/IgorKowalczyk/discord-activity.git
  • Create a branch from main and give it a meaningful name (e.g. my-awesome-new-feature).
  • Open a pull request on GitHub and clearly describe the feature or fix you are proposing.

๐Ÿ“‹ License

This project is licensed under the MIT. See the LICENSE file for details

discord-activity's People

Contributors

igorkowalczyk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

Forkers

barbarkey

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.