Skip to content

Build your first bot

Terminal window
bunx popii init
cd my-bot
bun run dev

The initializer creates src/index.ts, popii.config.ts, command directories, tests, and an environment file. Put the Discord token in .env; never commit it.

Create src/commands/ping.ts:

import { command } from "popii-framework";
export default command({
name: "ping",
description: "Replies with pong",
slash: true,
async do(pop) {
await pop.reply("Pong!");
},
});

Then verify and synchronize:

Terminal window
bunx popii doctor
bunx popii test
bunx popii sync