Skip to content

Latest commit

 

History

History
29 lines (21 loc) · 1 KB

README.md

File metadata and controls

29 lines (21 loc) · 1 KB

Discord Avatar Cloudflare Worker

Get a user's Discord avatar by their ID. This worker allows CORS from any origin, and can be embedded into websites, using your Discord profile as a sort of proto-Gravatar.

Usage

https://your.workers.dev/(id)

Optional parameters

Parameter Default
format png
resolution 1024

Deployment

This project uses Upstash Redis to cache the avatars. You can get a free account here.

  • Create a new Upstash Redis instance, and save the URL and password.
  • Create a Discord bot and save the token. No intents are required.
  • Fork this repository, and deploy it to Cloudflare Workers.
  • Go to the Worker settings and add the following secrets:
    • UPSTASH_REDIS_URL: The URL of the Upstash Redis instance.
    • UPSTASH_REDIS_TOKEN: The password of the Upstash Redis instance.
    • DISCORD_TOKEN: The token of the Discord bot.
  • Redeploy the Worker, and optionally set up Workers Builds.
  • Enjoy!