Slash-command bot for AniVault, hosted on Vercel. Talks to Discord and to the AniVault site directly — there's no relay in between anymore.
/anime <title>— looks up an anime on MyAnimeList directly and posts an embed./user <username>— looks up an AniVault profile by calling the site's/api/discord_user.phpendpoint (D1-backed, protected byBOT_SECRET), then edits the deferred reply with the profile embed.
Discord --(interaction)--> this bot (Vercel) --(HTTP, BOT_SECRET header)--> AniVault site (Cloudflare Worker, D1)
Login/registration notification embeds are not handled by this bot —
the site posts those straight to its Discord log channel itself using its
own DISCORD_BOT_TOKEN. This bot only serves slash commands.
- Copy
.env.exampleto.envand fill in values (see comments there). npm install- Register slash commands once (and again whenever you change them):
npm run register-commands - Set the same env vars in the Vercel project settings, then deploy:
npm run deploy - In the Discord Developer Portal, set the app's Interactions Endpoint URL
to
https://<your-vercel-domain>/api/interactions.
On the site side, make sure these are set (wrangler secret put ...):
DISCORD_BOT_TOKEN, DISCORD_SERVER_ID, BOT_SECRET (same value as here),
plus the DISCORD_LOG_CHANNEL_ID var in wrangler.toml for notifications.