Prerequisites
Before you begin, make sure you have:- A Discord bot token (create one at the Discord Developer Portal)
- Access to a flora runtime instance (see Installation for setup)
- Node.js installed for local development
Create Your First Bot
Create your bot script
Create a file called
src/main.ts with a simple ping command:src/main.ts
No imports needed! All flora SDK functions are available globally in the runtime.
Deploy to flora
Use the flora CLI to deploy your bot to a guild:The CLI will bundle your TypeScript code and deploy it to the runtime.
Add More Features
Let’s enhance your bot with a slash command and KV storage:src/main.ts
What You’ve Learned
Commands
Create prefix and slash commands with options and subcommands
KV Storage
Store and retrieve data with the built-in KV store
Events
Listen to Discord events like messages and reactions
Embeds
Create rich embeds with colors, fields, and images
Next Steps
Explore the SDK
Learn about all available SDK features in the SDK Guide
Add event handlers
React to Discord events with the Events API
Schedule tasks
Run periodic tasks with Cron Jobs
Deploy to production
Set up your own flora runtime with the Installation Guide