jinx-vi-0 / DDoL

Daily Dose of Leetcode
https://shorturl.at/ca4kT
MIT License
5 stars 6 forks source link

Refactor Discord Bot for Improved Command Handling and Error Management #6

Open chikatlarakesh opened 2 days ago

chikatlarakesh commented 2 days ago

This pull request introduces several enhancements to the Discord bot for better maintainability and user experience. The following changes have been made:

  1. Command Handling: Implemented a more structured command handling mechanism using a prefix constant for easier addition of future commands.
  2. Error Management: Enhanced error handling to provide more descriptive messages, aiding in debugging when errors occur.
  3. Message Formatting: Consistently utilized template literals for message formatting to improve readability.
  4. Configuration Management: Added constants for command prefix and timezone for clarity and ease of updates.
  5. Async/Await Consistency: Ensured all asynchronous function calls are properly awaited, reducing the risk of unhandled promise rejections.

These improvements aim to make the bot more robust and easier to manage as additional features are integrated.