Problem Statement
Currently, the AI chatbot history is stored in-memory. This causes context loss whenever the bot process restarts or crashes. We need to migrate this to a persistent SQLite database to ensure continuity for users.
Acceptance Criteria
1. Database Schema
2. Functional Requirements
3. Technical Constraints (TypeScript/Node.js)
4. Verification & Testing
Example code already exists for pterodactyl integration using the database service.
Problem Statement
Currently, the AI chatbot history is stored in-memory. This causes context loss whenever the bot process restarts or crashes. We need to migrate this to a persistent SQLite database to ensure continuity for users.
Acceptance Criteria
1. Database Schema
chatbot.db) must be initialized on startup.chat_historytable with the following schema:id: INTEGER PRIMARY KEY AUTOINCREMENTchannel_id: TEXT (Index for fast lookups)role: TEXT (e.g., 'user', 'assistant')content: TEXTcreated_at: DATETIME DEFAULT CURRENT_TIMESTAMP2. Functional Requirements
channel_idto provide context to the LLM.3. Technical Constraints (TypeScript/Node.js)
async/await) to avoid blocking the Discord.js event loop.4. Verification & Testing
Example code already exists for pterodactyl integration using the database service.