You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -4,74 +4,175 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
4
4
5
5
## Project Overview
6
6
7
-
This is a TypeScript-based Markov chain text generation system with OpenAI integration. The project generates text using Markov chains trained on input data and can optionally use OpenAI's API for enhanced text generation and conversation handling.
7
+
This is a Discord.js bot written in TypeScript, built on the Discord Bot TypeScript Template. The bot features a fishing game with an economy system, AI-powered image generation, and OpenAI integration for enhanced interactions.
8
8
9
9
## Development Commands
10
10
11
11
### Build and Development
12
12
```bash
13
13
npm run build # Compile TypeScript to JavaScript
14
-
npm run dev # Run development server with hot reload
15
-
npm start # Start the production server
14
+
npm start # Start the bot (single instance)
15
+
npm run start:manager # Start with shard manager for multiple shards
16
+
npm run start:pm2 # Start with PM2 process manager
16
17
```
17
18
18
19
### Code Quality
19
20
```bash
20
21
npm run lint # Run ESLint for code linting
21
22
npm run lint:fix # Fix auto-fixable linting issues
22
-
npm run typecheck # Run TypeScript type checking
23
+
npm run format # Check code formatting with Prettier
24
+
npm run format:fix # Fix code formatting issues
23
25
```
24
26
25
27
### Testing
26
28
```bash
27
29
npm test# Run all tests
30
+
npm run test:unit # Run unit tests only
31
+
npm run test:integration # Run integration tests only
28
32
npm run test:watch # Run tests in watch mode
33
+
npm run test:coverage # Run tests with coverage report
29
34
```
30
35
31
-
## Architecture Overview
32
-
33
-
### Core Components
36
+
### Database Management
37
+
```bash
38
+
npm run db:generate # Generate database migrations
39
+
npm run db:push # Push schema changes to database
40
+
npm run db:migrate # Run database migrations
41
+
npm run db:seed # Seed database with initial data
42
+
npm run db:setup # Push schema and seed data
43
+
npm run db:studio # Open Drizzle Studio for database management
44
+
```
34
45
35
-
-**MarkovChain** (`src/MarkovChain.ts`): The main class implementing Markov chain text generation
36
-
- Handles state transitions and probability calculations
37
-
- Supports configurable order (n-gram size) for chain complexity
38
-
- Provides text generation with customizable parameters
46
+
### Command Management
47
+
```bash
48
+
npm run commands:view [GUILD_ID] # View registered commands
49
+
npm run commands:register [GUILD_ID] # Register commands (guild-specific if ID provided)
50
+
npm run commands:clear [GUILD_ID] # Clear registered commands
51
+
npm run commands:rename # Rename a command
52
+
npm run commands:delete # Delete a specific command
53
+
```
39
54
40
-
-**OpenAI Integration** (`src/openai.ts`): Handles OpenAI API interactions
41
-
- Thread management for conversation context
42
-
- Response generation and processing
43
-
- Credit tracking and usage monitoring
55
+
## Architecture Overview
44
56
45
-
-**Type Definitions** (`src/types.ts`): Core TypeScript interfaces and types
46
-
-`MarkovState`: Represents chain states and transitions
47
-
-`GenerationOptions`: Configuration for text generation
48
-
- OpenAI-related types for API integration
57
+
### Core Components
49
58
50
-
-**Utilities** (`src/utils.ts`): Helper functions for data processing
51
-
- Text preprocessing and tokenization
52
-
- File I/O operations
53
-
- Data validation and sanitization
59
+
-**Bot Initialization** (`src/start-bot.ts`, `src/start-manager.ts`): Entry points for bot and shard manager
0 commit comments