Create your first bot
This guide walks you through your first DisFlow bot. It takes about ten minutes.
Before you begin
Section titled “Before you begin”You will need:
- A Discord account and a server where you can add bots.
- The DisFlow editor open in your browser. If it is not running yet, see Self-hosting.
- Node.js 18+ only if you plan to run the exported bot on your own computer.
1. Prepare your Discord bot
Section titled “1. Prepare your Discord bot”-
Open the Discord Developer Portal.
-
Create a new application.
-
Go to Bot and copy the token. Keep it private — Discord only shows it once.
-
Still under Bot, enable the settings your bot will need:
- Message Content — to read what people type.
- Server Members — to see members join, leave or update.
- Presence — to see online status.
-
Invite your bot to your server with the
botandapplications.commandspermissions.
2. Add the bot to DisFlow
Section titled “2. Add the bot to DisFlow”- Open the DisFlow bot list.
- Select New bot.
- Paste your bot token and give the project a short description.
- Select Create. DisFlow checks the token with Discord.
- Confirm that the bot shown is yours.
- Choose a 6-digit passcode.
3. Give your bot something to do
Section titled “3. Give your bot something to do”You can start in the Main file, which runs once when the bot starts up. Or jump straight to an event — a moment your bot reacts to.
Example: reply to a message
Section titled “Example: reply to a message”- Open Events.
- Turn on Message.
- Open its editor.
- Add Reply To Message.
- Connect Event Value (
message) to the block’s Message input. - Type
Hello!into the Content field. - Select Save.
Now your bot replies to every message it can read. You can use If and Text Includes to reply only when a message contains a particular word.
4. Add a slash command
Section titled “4. Add a slash command”- Open Commands and select Create command.
- Name it
pingand give it a short description, such as “Check that the bot is online”. - Open the command editor.
- Add Reply To Interaction and connect it to the command’s start block.
- Set the reply text to
Pong!. - Select Save.
5. Save everything, then export
Section titled “5. Save everything, then export”Save each graph you edited. Then select Export bot on the overview, events or commands page.
You will get a ZIP file. Unzip it, then follow the steps in Exporting your bot. To keep the bot online all the time, see Keeping your bot online.