Skip to content

Latest commit

 

History

History
45 lines (27 loc) · 2.22 KB

README.md

File metadata and controls

45 lines (27 loc) · 2.22 KB

BoomBot: Create your own music samples on Discord

BoomBot is a Discord bot that generates music samples in seconds using MusicGen. See the demo with audio here. You can try BoomBot out for yourself by joining the Discord server and typing /generate in the #general channel.

This entire app, from the backend API to the web app, is deployed serverlessly on Modal.

File structure

  1. React Frontend (src/frontend/)
  2. FastAPI server (src/bot.py)
  3. Language model (src/main.py)

Read our accompanying docs for further detail on how it all works.

Developing locally

Set up Modal

  1. Create a Modal account.
  2. Install modal in your current Python virtual environment (pip install modal)
  3. Set up a Modal token in your environment (modal token new)

Create a Discord app

Follow the steps in our docs to create a new Discord app and set up a Modal secret called boombot-discord-secret with the key DISCORD_PUBLIC_KEY.

You can serve the app ephemerally on Modal by running this command from the repo's root directory:

modal serve src.bot

You'll then see a URL printed in the terminal output (like https://rachelspark--boombot-app-dev.modal.run) that you can then use to navigate to the web app in your browser, and use as a root path for the webhook your Discord app will request when a user interacts with it. You should point your Discord app to your POST endpoint on this URL in the Discord Developer Portal (as explained in the docs) and develop the bot while the modal serve process is running, as changes to any of the project files will be automatically applied.

Deploy your app

Once you're satisfied with your changes, your can deploy your app using

modal deploy src.bot

Make sure to update the URL your Discord app points to.