Getting Started
-
Create a new project
Copy the linked files.
Directorysrc
- .env.example Rename file to .env
- package.json
- tsconfig.json When using TypeScript
- …
Add to
package.json
type and scripts. -
Setup discord bot - Discord Docs
Create a New Application from Dashboard.
Copy yourAPPLICATION ID
,PUBLIC KEY
andTOKEN
, and put them.env
file.Storing secrets.
Register commands and deploy.
Set endpoint url.
Enter
https://YOUER_PROJECT.YOUER_DOMAIN.workers.dev
in the INTERACTIONS ENDPOINT URL. -
Invite bot
Create an invite URL from the Dashboard.
YOUR_APP
>OAuth2
tab >OAuth2 URL Generator
> Check SCOPES:bot
> URLCopy
Paste the URL into the browser.
Examples
- Simple Example
- Playing with AI - Using Cloudflare AI
- Deliver website news - Using Cloudflare D1, Browser Rendering, Cron