Skip to content

Discord bot deployed via Cloudflare Workers, complete with AI text and text-to-image generation commands.

Notifications You must be signed in to change notification settings

imgta/discord-cf-worker

Repository files navigation

Discord Bot on Cloudflare Worker

Quick Start

Setup:

  1. Register all slash commands via npm run register
  2. 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=...
  1. Make sure these same environment variables are exposed to your Cloudflare Worker via your Workers & Pages dashboard
  2. After pushing a change to the main branch, set your Cloudlfare Worker URL as your Discord application's INTERACTIONS ENDPOINT URL and save

Local Testing:

  1. Start wrangler via npm run dev
  2. Start live, accessible URL endpoint via npm run tunnel
  3. Set the tunnel URL as your Discord application's INTERACTIONS ENDPOINT URL and save
  4. Try using the /hello command in a channel

About

Discord bot deployed via Cloudflare Workers, complete with AI text and text-to-image generation commands.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published