Your first bot
By the end of this page your bot is online in a test server and answers /ping.
Create the Discord application
Section titled “Create the Discord application”-
Open the Discord Developer Portal and choose New Application.
-
Go to Bot and press Reset Token. Copy the token and keep the page open. Treat the token like a password: anyone who has it controls your bot.
Create the project
Section titled “Create the project”-
In Makecord, choose New project, give the bot a name and pick a folder. The project starts with two commands,
/pingand/greet, and areadyevent. -
Press Open Secrets on the Get started tab, paste the token into
DISCORD_TOKENand save. The token is encrypted with your system keychain. It’s never written to the project folder, and you can’t view it again in the IDE. -
Press Create invite link on the Get started tab, or choose Run › Invite bot to a server. Makecord reads the bot’s ID from the token and ticks the permissions your blocks need, such as Manage Roles for Add Role. Open the link and pick a server you manage. If the project uses privileged intents, the dialog links straight to the page where you turn them on.
-
Open
makecord.jsonand add your test server’s ID asdevGuildId. To find the ID, enable Developer Mode in Discord’s settings, then right-click the server and choose Copy Server ID.makecord.json {"specVersion": 1,"name": "My bot","devGuildId": "123456789012345678","intents": ["Guilds"]}With
devGuildIdset, slash commands register to that server only and show up instantly. Without it they register for every server, which can take a while to reach Discord clients.
Run it
Section titled “Run it”Press Run in the toolbar. The Run panel shows the bot coming online:
19:42:07 ● Running My bot#4821 is online in 1 server19:42:08 Registered 2 commands on the test server /greet /pingType /ping in your server. The bot replies with its latency, and in the editor the blocks it ran light up for a moment.
Next steps
Section titled “Next steps”- Learn how flows work in Flows and which values you can use in messages in Variables.
- Browse every block in the Blocks reference.