Synapse Base v2 - The Overhaul Update
Major Features
- Hot Reload System – Live code updates without bot restarts
- Database Integration – MongoDB and SQLite support with automatic setup
- Package Management – Automatic dependency handling and cleanup
Systems & Architecture
Process Management
const MAX_RECONNECT_ATTEMPTS = 5;
const RECONNECT_INTERVAL = 5000;
const attemptReconnect = () => {
if (reconnectAttempts < MAX_RECONNECT_ATTEMPTS) {
reconnectAttempts++;
console.log(`Attempting to reconnect... (${reconnectAttempts}/${MAX_RECONNECT_ATTEMPTS})`);
}
}
- Auto-reconnection with configurable attempts
- Graceful shutdown handling
- Enhanced error catching
Command System Overhaul
if (command.devGuild) {
guildCommands.push(command.data.toJSON());
} else {
globalCommands.push(command.data.toJSON());
}
- Split between global/guild commands
- Dev guild support
- Improved validation
Component Architecture
client.componentsByType = new Map();
const usedCustomIds = new Set();
if (usedCustomIds.has(component.customId)) {
client.logs.error(`Duplicate customId "${component.customId}" found. Component IDs must be unique.`);
}
- Type categorization
- CustomId conflict prevention
- Improved validation
Performance & Reliability
- Optimized command registration
- Enhanced error boundaries
- Memory leak prevention
- Improved file handling
Developer Experience
Enhanced Logging
const logLevels = new Map([
['database', { color: colors.fg.orange, label: "DATABASE" }],
['startup', { color: colors.fg.purple, label: "STARTUP" }],
['hotReload', { color: colors.fg.white, label: "HOTRELOAD" }]
]);
- New log types and categories
- Color-coded outputs
- Better timestamp formatting
Debug Features
- Component tracking
- Database connection monitoring
Bug Fixes
- Fixed command cooldown memory leaks
- Resolved component registration conflicts
- Fixed event handler memory issues
- Improved error catching in interaction handling
Migration Notes
- Database configuration required in
config.json
- New folder structure for components
- Updated event handling implementation