Overview
The bot provides community management, information distribution, and interactive features for the SkyTeam Discord server. Package:@skyteam/clientLocation:
apps/clientType: ES Module
Technology Stack
- Discord Library: Discord.js v14
- Command Framework: discordx v11
- Utilities: @discordx/pagination, @discordx/utilities
- Database: Prisma via
@skyteam/database - Build Tool: tsup with ESM output
Project Structure
Bot Configuration
Client Setup
The bot client (src/index.ts:12) is configured with required intents and settings:
apps/client/src/index.ts
Bot Lifecycle
apps/client/src/index.ts
Event Handlers
apps/client/src/index.ts
Commands
Public Commands
Ping Command
Simple latency test command (src/commands/public/ping.ts:6):
apps/client/src/commands/public/ping.ts
Admin Commands
Setup Channel Command
Creates formatted channel content with embedded media and interactive components (src/commands/private/setupchannel.ts:17):
apps/client/src/commands/private/setupchannel.ts
Channel Setup Features
Thesetupchannel command creates rich portal messages with:
Portal Channel Setup (src/commands/private/setupchannel.ts:32):
- Alliance description and branding
- Community rules and guidelines
- Social media links (Discord, Twitter, ROBLOX)
- Interactive buttons for external links
- Media galleries with branded images
src/commands/private/setupchannel.ts:64):
src/commands/private/setupchannel.ts:92):
UI Components
Discord Components V2
The bot uses Discord’s new Components V2 system:- ContainerBuilder: Layout containers
- TextDisplayBuilder: Text content blocks
- MediaGalleryBuilder: Image galleries with captions
- SectionBuilder: Structured sections with accessories
- ButtonBuilder: Interactive buttons
- SeparatorBuilder: Visual separators with spacing control
Component Example
Error Handling
Graceful Error Recovery
The bot catches command errors and displays user-friendly messages:Development
Scripts
Environment Variables
Required environment variables:Dependencies
apps/client/package.json
Command Loading
Commands are automatically imported using discordx importer:apps/client/src/index.ts
- Commands: All files in
commands/subdirectories - Events: Custom event handlers
- Guards: Permission and validation guards
Integration with SkyTeam
The bot integrates with:@skyteam/database- User and airline data queries@skyteam/api- Real-time flight and status updates- External APIs - ROBLOX user data, avatar lookups
Bot Permissions
Required Discord permissions:- Read Messages/View Channels
- Send Messages
- Embed Links
- Attach Files
- Use External Emojis
- Add Reactions
- Manage Messages (for moderation)
- Read Message History
Deployment
Recommended deployment:- Hosting: Railway, Heroku, or VPS
- Process Manager: PM2 or systemd
- Monitoring: Error tracking and uptime monitoring
- Logging: Structured logging for debugging