Skip to content

Manual Setup

The different packages

Currently lilybird is divided into 3 pieces.

  • lilybird - The core and all you need to make your bot.
  • @lilybird/jsx - JSX components for lilybird using react-jsx.
  • @lilybird/handlers - Command and Event handlers for lilybird.

There is also @lilybird/create which is the boilerplate generator used in the previous page.

Creating the bot

Creating the bot with lilybird is a trivial task.

index.ts
import { createClient, Intents } from "lilybird";
await createClient({
token: process.env.TOKEN,
intents: [Intents.GUILDS],
listeners: {/* your listeners */}
})

Adding types to process.env

In case you are using TypeScript we highly encourage adding proper types to your process.env.

This can be done by creating a globals.d.ts file on the root of your project.

globals.d.ts
declare module "bun" {
interface Env {
TOKEN: string;
// Other env variables
}
}

And then addint the following to your tsconfig.json.

tsconfig.json
{
"compilerOptions": {
"types": [
"./globals"
]
}
}