Skip to content

Manual Setup

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 adding the following to your tsconfig.json.

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