- Register all slash commands via
npm run register
- Create
.env
populated with the necessary environment variables:
DISCORD_TOKEN=...
DISCORD_PUBLIC_KEY=...
DISCORD_APPLICATION_ID=...
DISCORD_GUILD_ID=...
DISCORD_CHANNEL_ID=...
CLOUDFLARE_ACCOUNT_ID=...
CLOUDFLARE_API_TOKEN=...
CLOUDFLARE_WORKERS_GATEWAY_ID=...
- Make sure these same environment variables are exposed to your Cloudflare Worker via your Workers & Pages dashboard
- After pushing a change to the main branch, set your Cloudlfare Worker URL as your Discord application's
INTERACTIONS ENDPOINT URL
and save
- Start wrangler via
npm run dev
- Start live, accessible URL endpoint via
npm run tunnel
- Set the tunnel URL as your Discord application's
INTERACTIONS ENDPOINT URL
and save - Try using the
/hello
command in a channel