Skip to content

Refactor#85

Merged
sneak-it merged 41 commits into
masterfrom
refactor
May 10, 2026
Merged

Refactor#85
sneak-it merged 41 commits into
masterfrom
refactor

Conversation

@sneak-it
Copy link
Copy Markdown
Member

Actively working on refactor and modernization of the bot

sneak-it added 30 commits March 4, 2026 20:24
…g DM

- Added proper null checks and error handling for user fetch failures
- Improved fallback notification logic when DM fails

- Added `collector.on("error", ...)` handlers to both reaction collectors
- Added `finally` blocks to ensure collectors are properly stopped
- Added debug logging for message deletion errors

- Created a centralized `MAP_CONFIG` object with configuration for surf, kz, and bhop maps
- Added `getMapType()` helper function to determine map type
- Consolidated `getWebsite()`, `getStatsPage()`, and `getMapImage()` functions to use the shared configuration
- Eliminated code duplication across all three functions

- Added null checks for guild and channel existence
- Added warning logs when guild or channel is not found
- Prevents crashes when commands are sent before bot is fully ready

- Created `validateMapName()` function with comprehensive validation
- Validates for empty input, mentions, invalid characters, and length limits
- Applied to both `follow` and `unfollow` commands

- No `var` declarations found in the codebase (already using `let`/`const`)

- Duplicate `messageCreate` event handler merged into single handler with routing
- Server refresh parallelized using `Promise.all()`
- `isEmpty` function fixed to use `Object.keys().length === 0`
- `keywordToServer` function fixed to return `null` instead of `false` and made async
- Database error logging added to all functions in db.js
Comment thread src/commands/adminCommands.js Fixed
Comment thread src/commands/adminCommands.js Fixed
Comment thread src/commands/adminCommands.js Fixed
Comment thread src/commands/adminCommands.js Fixed
Comment thread src/commands/adminCommands.js Fixed
Comment thread src/embeds/playerEmbeds.js Fixed
Comment thread src/embeds/playerEmbeds.js Fixed
Comment thread src/embeds/playerEmbeds.js Fixed
Comment thread src/embeds/serverEmbeds.js Fixed
Comment thread src/embeds/serverEmbeds.js Fixed
@sneak-it sneak-it marked this pull request as ready for review May 10, 2026 18:09
@sneak-it sneak-it merged commit e9edb55 into master May 10, 2026
5 checks passed
@sneak-it sneak-it deleted the refactor branch May 10, 2026 18:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants