This is a simple Discord bot using Flyde and Discord.js. It exposes a "/joke" command that will send a random joke (using https://jokeapi.dev/) to the channel where the command was sent.
This project implements a convention over configuration approach, where the bot will automatically load all the commands in the commands
folder. Each command is a folder containing:
- a
config.json
file, conforming to Discord's slash command schema - A Flyde based and a
Handler.flyde
file, containing the command's logic completely visual!
This example comes with 2 commands:
/joke
- Sends a random joke to the channel where the command was sent/ping
- Sends a "pong" message to the channel where the command was sent
- Node 16+
- The Flyde VSCode extension
- A Discord bot token - See guide
- Rename
.env.example
to.env
- Set your discord bot token and client ID in the
.env
file. See this guide npm install
npm run dev
- run
npm run new-command
- Follow the instructions
- Once the command folder is created, edit the
Handler.flyde
flow using the Flyde VSCode extension as you wish. See the Flyde docs for more info. - Restart the bot
- Done!
A key design goal of Flyde is to be as integrable as possible with existing Node.js projects. Flyde flows are YAML files behind the scenes, which are loaded and executed using a library. This means that you can use Flyde in any Node.js project, and deploy it to any Node.js hosting service!
We've tested it on Railway and it works great!
Note: accessing the visual debugger from a remote deployment is not supported yet. You can still use the visual debugger locally, and use the logs to debug your flows remotely.