Currently the documentation here pertains to the canary tag of Dressed (dressed@1.10.0-canary.5.x
), keep in mind that some items (especially talked about in the deployment guides) are not available / work slightly differently in the @latest
version.
Deploying to Cloudflare Workers
This guide walks you through deploying a Discord bot built with Dressed to Netlify Functions.
Deploying is the last step in building your bot, it will be where Discord can send interactions and events even when you're not developing it.
Setup
-
Add the following to your
netlify.toml
file:netlify.toml build.command = "dressed build"
-
netlify / functions / bot.mts // @ts-ignore Generated after build import { commands, components, events, config } from "../../.dressed"; import { handleRequest } from "dressed/server"; export default (req: Request) => handleRequest(req, commands, components, events, config);
Environment variables
If you are creating a new project, you will need to upload your environment variables to be used by the bot. Netlify documentation.
Upload
You now can upload it to Netlify however you like, either through linking to GitHub, or using the CLI:
bunx netlify build
bunx netlify deploy --prod
Your bot should now be accessible at <project>.netlify.app/.netlify/functions/bot
.