Changelog
Update Summary
The bot has undergone a comprehensive refactor to transition from a synchronous HTTP request model to a Discord bot using asynchronous operations. The new version also introduces a modal for streamlined user input, enhanced interaction features, and structured logging improvements.
Added
- Discord Integration: Migrated to a fully Discord-based bot with
discord.py
, utilizing buttons, modals, and commands for user interaction. - Asynchronous Handling: All HTTP requests are now asynchronous with
aiohttp
, improving responsiveness and performance. - Logging Updates: Logs now include specific player interactions, such as VIP additions and blacklist removals, ensuring better traceability.
- Player Data Import Modal: New
ImportModal
UI for inputting API details within Discord. - Import Progress and Log Feedback: User receives a direct message with a log file upon successful data import.
Changed
- API Call Structure: Replaced synchronous
requests
calls with asynchronousaiohttp
sessions. - Refactored Player Data Processing: Updated logic to read and process player files, with explicit error handling and feedback.
- Blacklist Handling:
create_or_get_blacklist
now handles cases of blacklist creation or retrieval with specific error feedback.
Fixed
- Error Handling: Added error-specific logging, particularly for async API calls, enhancing diagnostics for API errors.
- Channel Messaging: Ensured the bot targets a specific channel ID, verified upon initialization.
This update leverages async capabilities, which improve the bot's performance and user experience in handling Discord interactions and external API calls.