Skip to content

An example of stateless Discord Bot using Slash Commands feature and Cloudflare Workers.

License

Notifications You must be signed in to change notification settings

siketyan/stateless-discord-bot

Repository files navigation

🧲 Stateless Discord Bot

Rust Rust

An example of stateless Discord Bot using Slash Commands feature and Cloudflare Workers.

✨ Features

  • 🦀 Using Rust (with WebAssembly)!
  • 🔌 You can create a stateless Discord Bot
  • 🛠 Of course it is serverless
  • 💰 Free for 100,000 requests with Cloudflare Workers

📦 Installation

  1. Clone this repository.
  2. Copy wrangler.example.toml, then rename it to wranger.toml .
  3. Edit the file, filling account_id and vars.PUBLIC_KEY .
  4. Deploy using wrangler publish .
  5. Register your endpoint at Discord Developer Portal.
  6. Create an application command. For example:
    $ curl \
      -H "Authorization: Bot ${DISCORD_BOT_TOKEN}" \
      -H "Content-Type: application/json" \
      -d '{"name":"hello","description":"The bot will say \"Hello, world!\"."}' \
      "https://discord.com/api/v8/applications/${APPLICATION_ID}/commands"
  7. Done!

About

An example of stateless Discord Bot using Slash Commands feature and Cloudflare Workers.

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Languages