Skip to content

Latest commit

 

History

25 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AniVault Discord Bot

Slash-command bot for AniVault, hosted on Vercel. Talks to Discord and to the AniVault site directly — there's no relay in between anymore.

Commands

  • /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.php endpoint (D1-backed, protected by BOT_SECRET), then edits the deferred reply with the profile embed.

Architecture

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.

Setup

  1. Copy .env.example to .env and fill in values (see comments there).
  2. npm install
  3. Register slash commands once (and again whenever you change them):
    npm run register-commands
    
  4. Set the same env vars in the Vercel project settings, then deploy:
    npm run deploy
    
  5. 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.

About

Resources

Stars

4 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages