Flyde is a powerful visual flow-based programming toolkit that enables you to create and edit code using a visual flow-based programming interface. With Flyde, you can build backend flows quickly and intuitively, making it ideal for novice developers, non-developer technical teams, and experienced developers who want to prototype and test ideas fast.
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+
- pnpm -
npm install -g pnpm
- 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 pnpm install
pnpm run dev
- run
pnpm 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!
As this is a regular Node.js project, you can deploy it to any Node.js hosting service. We've tested it on Railway and it works great!