Skip to content
This repository has been archived by the owner on Jun 2, 2022. It is now read-only.

Serverless Discord Bot on Cloudflare Workers

License

Notifications You must be signed in to change notification settings

pmh-only/ServerlessDiscordBot

Repository files navigation

ServerlessDiscordBot

Simple Discord bot on cloudflare workers

2022-01-06_11-40-07.mp4

image

Step-by-step guide

1. install cloudflare wrangler

npm install -g @cloudflare/wrangler

or

yarn global add @cloudflare/wrangler

2. login cloudflare wrangler

wrangler login

3. clone repository

git clone https://github.com/pmh-only/ServerlessDiscordBot.git
cd ServerlessDiscordBot

4. install dependancies

npm i

or

yarn

5. edit configuration file

edit wrangler.toml:

name = "YOUR_APP_NAME_HERE"
type = "javascript"
zone_id = ""
account_id = "YOUR_ACCOUNT_ID_HERE"
route = ""
workers_dev = true
compatibility_date = "2022-01-06"

[build]
command = "yarn && yarn build"
[build.upload]
format = "service-worker"

6. publish your worker

wrangler publish

7. get application's public key

8. get application's bot token

9. apply them

10. regist global application command

node ./utils/cmdctl.js -i <APP_ID> -t <BOT_TOKEN> create ping ping

11. done!

https://discord.com/api/oauth2/authorize?client_id=<APPLICATION_ID_HERE>&scope=applications.commands

About

Serverless Discord Bot on Cloudflare Workers

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published