cd discord-bot-cloudflare-ai
npm iCreat API Token
Select template Workers AI
npx wrangler secret put ACCOUNT_ID
npx wrangler secret put AI_API_TOKENOptional: Set Caching and Rate-limiting
Create a New Application from Dashboard.
Copy your APPLICATION ID, PUBLIC KEY and TOKEN, and put them .env file.
Storing secrets.
npx wrangler secret put DISCORD_APPLICATION_ID
npx wrangler secret put DISCORD_PUBLIC_KEY
npx wrangler secret put DISCORD_TOKENRegister commands and Deploy.
npm run register
npm run deployEnter https://YOUER_PROJECT.YOUER_DOMAIN.workers.dev in the INTERACTIONS ENDPOINT URL.
Create an invite URL from Dashboard.
YOUR_APP > OAuth2 tab > OAuth2 URL Generator > Check SCOPES: bot > URL Copy
Paste the URL into the browser.