A fork of Cloud Sync. A service built using Hono to show off songs on your Discord profile.
You can find the API documentation here
# install without optionalDependencies
$ bun install --omit=optionalYou need:
- Cloudflare D1 database1
- Discord application
- Randomly generated JWT secret2
In your Discord application's page, go to the OAuth2 tab and create a new OAuth2 Redirect in the format of https://your-worker.workers.dev/api/auth/authorize and http://localhost:8787/api/auth/authorize
After that, create a .dev.vars file based on .dev.vars.example with all of your secrets filled in, then run:
# publish secrets
$ bunx wrangler secret bulk .dev.vars# development
$ bun run dev
# bench the size of your deployment
$ bun run dry-deploy
# deploy
$ bun run deployAlong with the Discord application for OAuth2, you can also create a Discord bot. This allows you to:
- Enable the
/songspotlightDiscord command — users will need to add your app as an userapp (theapplications.commandsscope) or add it to their server to use the command - Enable the Silly service — a cron schedule that runs every day at 2:00 AM UTC which generates a randomized color palette for its avatar, banner and even FPTE
To create a bot user, go to the Bot tab in your Discord application's page, create it, and save its token in .dev.vars:
# optional, only used for extra bot features
CLIENT_TOKEN="Bot [your token here]"
Then run:
# publish secrets
$ bunx wrangler secret bulk .dev.varsTo enable the Discord command, start with enabling Public Bot in the Bot tab, along with User Install and Guild Install in the Installation tab.
You can also optionally set a Last.fm API key.
Then, set Interactions Endpoint URL in the General Information tab to https://your-worker.workers.dev/api/bot/interaction. Copy your application's Public Key and put it in .dev.vars. Then run:
# publish secrets
$ bunx wrangler secret bulk .dev.vars
# create global commands
$ bun run commandsTo enable the Silly service, run:
# install @resvg/resvg-wasm
$ bun installThere are some basic tests in the test folder, but if you're feeling brave enough, feel free to write some actual unit tests!
MIT