Skip to content

Conversation

@fentbuscoding
Copy link
Contributor

This pull request introduces enhancements and fixes across multiple modules, focusing on improving error handling, adding functionality, and refining code consistency. Key changes include the addition of fallback mechanisms for database operations, enhanced error messages for moderation commands, and updates to command aliases and parameters for better usability.

Moderation Enhancements:

  • Fallback for Warnings: Added save_warn_fallback to store warnings in a JSON file if database operations fail. This ensures warnings are logged even during database outages. (cogs/Moderation.py, [1] [2]
  • Improved Error Handling: Enhanced error messages for moderation commands like timeout, kick, ban, and others, providing clearer guidance to users when required parameters are missing or invalid. (cogs/Moderation.py, cogs/Moderation.pyR323-R400)
  • Command Aliases: Added aliases for moderation commands (e.g., .kick -> .k, .ban -> .b) to improve command accessibility. (cogs/Moderation.py, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Code Consistency:

  • Datetime Usage: Standardized datetime references to datetime.datetime.utcnow() across moderation commands for better readability and consistency. (cogs/Moderation.py, [1] [2] [3] [4] [5] [6] [7] [8] [9] [10]

Fun Module Improvements:

  • Optional Parameters: Updated the timezone command to accept an optional discord.Member parameter for better flexibility. (cogs/fun/Other.py, cogs/fun/Other.pyL76-R78)
  • Error Messaging: Enhanced error messages in the timezone command to handle cases where the user's timezone is invalid, improving user feedback. (cogs/fun/Other.py, cogs/fun/Other.pyL95-R96)

Miscellaneous Fixes:

  • Autofishing Task: Resolved merge conflict in AutoFishing.py related to the cog_unload method, ensuring the autofishing task is properly canceled when the cog is unloaded. (cogs/economy/fishing/AutoFishing.py, cogs/economy/fishing/AutoFishing.pyR18-R23)
  • Imports: Added missing imports (os, json, Optional) in relevant files to support new functionality and improve type hinting. (cogs/Moderation.py, [1]; cogs/fun/Other.py, [2]

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.

1 participant