Skip to content

IgorKowalczyk/discord-activity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

60 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

About

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

Topics

Resources

License

Code of conduct

Security policy

Stars

Watchers

Forks

Sponsor this project