@biscotto/core
v1.8.0
Published
Biscotto Discord bot framework
Readme
@biscotto/core
Bot framework with dynamic module loading, process management, and a plugin-based architecture ~ one biscuit at a time.
Installation
npm install @biscotto/coreUsage
import 'dotenv/config';
import { run } from '@biscotto/core';
run();The run function bootstraps the bot: loads modules from .biscotto/modules/, registers commands with Discord, and connects. Environment variables (DISCORD_TOKEN, DISCORD_CLIENT_ID, DISCORD_GUILD_ID) are read from .env via dotenv.
Features
- Dynamic module loading from
.biscotto/modules/ - Dependency resolution with cycle detection
- Cross-platform process management via PID file
- Components V2 support for all Discord messages
- Guild-specific command deployment
- Modular storage (JSON, SQLite, YAML, MySQL)
defineCommand,defineButton,defineSelectMenu,defineModal,defineAutocomplete,defineUserContextMenu,defineMessageContextMenu,defineEvent,defineModulehelpers- InteractionRouter with custom ID matching
- Declarative intents
Module Contract
import { defineModule, defineCommand, defineButton } from '@biscotto/core';
const hello = defineCommand({
name: 'hello',
description: 'Say hello',
async execute(ctx) {
await ctx.reply('Hello!');
},
});
const helloBtn = defineButton({
customId: 'hello-btn',
async execute(ctx) {
await ctx.reply('Button clicked!');
},
});
export default defineModule({
manifest: {
name: 'my-module',
version: '1.0.0',
author: { name: 'Your Name' },
},
commands: [hello],
buttons: [helloBtn],
});