siketyan / vwatch

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

🧲 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

License:MIT License


Languages

Language:Rust 89.1%Language:JavaScript 10.9%