Overview of TSCord features and architecture
mainTSCord is a TypeScript-based Discord bot template built on top of discordx and discord.js v14. It is designed to provide a structured framework for building extensible bots.
Core Capabilities
- Advanced Handlers: Support for slash commands, context menus, buttons, modals, select menus, message commands, and Discord event listeners.
- Guards (Middleware): Functions that act as middleware for handlers. Built-in guards include:
- Rate limiter
- Maintenance mode
- Disabling commands
- Guild only (no DMs)
- NSFW only
- Regex-based message content matching
- Database & Persistence: Multiple database support via
Mikro-ORMwith a built-in migrations system. - State & Logic: Local store for global state management, a scheduler for cron jobs, and custom event handlers.
- Observability: Advanced logging (with file and Discord channel support), built-in statistics, and an internal API for external service interaction.
- Internationalization: Fully-typed localization (i18n).
Developer Experience
- Patterns: Built around Dependency Injection and Singleton patterns.
- Development Tools: Hot Module Replacement (HMR) for events and commands, VSCode debugging setup, and strict ESLint configuration.
- Deployment: Support for Docker, PM2, and GitHub Actions CI/CD.