npx create-cloudflare@latest cfw-tb --deploy=false --ts --accept-defaults && \
cd cfw && \
npx gts@latest init --yes && \
gi macos,node,osx,visualstudiocode >> .gitignore
the tsconfig is always updated so check the current tsconfig.json
with latest one.
npx tsc --init
latest typescript configuration can be generated by tsc
.
npx tsc --init
creating the database
npx wrangler@latest d1 create cfw-tb
put the database block from the command in the wrangler.toml
.
set the BOT_TOKEN
npx wrangler@latest secret put BOT_TOKEN
setup the webhooks
SHA256_BOT_TOKEN=$(echo -n ${BOT_TOKEN} | shasum -a 256 | cut -d' ' -f1)
curl "https://cfw-tb.smhmayboudi.workers.dev/${SHA256_BOT_TOKEN}/webhook/del"
curl "https://cfw-tb.smhmayboudi.workers.dev/${SHA256_BOT_TOKEN}/webhook/get"
curl "https://cfw-tb.smhmayboudi.workers.dev/${SHA256_BOT_TOKEN}/webhook/set"