CIRCE / DOCUMENTATION
Your first bot
From an empty folder to a bot answering /ping.
On this page
Assumes you did Requirements and Installation, and have your token and application ID.
1. Scaffold
In an empty folder:
# Node.js
npx @sxnnyside/circe init --runtime node --standard && npm install
# Bun
bun x @sxnnyside/circe init --runtime bun --standard && bun install
# Deno
deno run -A npm:@sxnnyside/circe/cli init --runtime deno --standard
Tiers: --minimal, --standard, --advanced. See circe init.
2. Credentials
Create .env from .env.example:
DISCORD_TOKEN=your-bot-token
DISCORD_CLIENT_ID=your-application-id
DISCORD_GUILD_ID=your-test-server-id
The loaded config must expose token and clientId, so map the variables in src/config.ts:
import { defineConfig } from "@sxnnyside/circe";
import { z } from "zod";
export default defineConfig(
z
.object({
DISCORD_TOKEN: z.string().min(1),
DISCORD_CLIENT_ID: z.string().min(1),
DISCORD_GUILD_ID: z.string().optional(),
})
.transform((env) => ({
token: env.DISCORD_TOKEN,
clientId: env.DISCORD_CLIENT_ID,
guildId: env.DISCORD_GUILD_ID,
})),
);
Why: Environment.
3. Run
npx circe doctor
npx circe dev
Invite the bot with an OAuth2 URL with scopes bot and applications.commands, then run /ping.
Next
- Add a command: Commands.
- Keep it alive: Deployment.
