-
-
Notifications
You must be signed in to change notification settings - Fork 41
feat(fact): improve fun facts command #861
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideRefactors the fun facts command to support multiple categories by introducing a FactType enum and separate fact lists, integrates slash-command metadata and a dynamic docstring decorator, and cleans up legacy hardcoded code. File-Level Changes
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the fun facts command by extending the available fact categories and updating the command’s behavior and embed presentation.
- Introduces three fact categories (Linux, Tux, and Cat) along with a RANDOM option that combines them.
- Adds a new docstring_parameter decorator to dynamically format docstrings.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tux/utils/functions.py | Added the docstring_parameter decorator to enable dynamic insertion into docstrings. |
| tux/cogs/fun/fact.py | Extended the fact command with multiple fact categories and enriched its embed. |
Comments suppressed due to low confidence (1)
tux/cogs/fun/fact.py:127
- [nitpick] The variable name 'sel' is ambiguous; consider renaming it to a more descriptive name like 'selected_fact_type' for clarity.
sel = category_map[fact_type]
|
I suggest moving these out of the file and into a new global data dir or something |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey @electron271 - I've reviewed your changes and they look great!
Here's what I looked at during the review
- 🟡 General issues: 2 issues found
- 🟢 Security: all looks good
- 🟢 Testing: all looks good
- 🟢 Complexity: all looks good
- 🟢 Documentation: all looks good
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR enhances the fun facts command by organizing facts into multiple categories (Linux, Cat, Tux, and Random) and allowing users to select a category via prefix and slash command interfaces. Key changes include introducing new category lists and the FactType enum, refactoring the command to validate category selections, and adding a docstring_parameter decorator for dynamic docstring formatting.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tux/utils/functions.py | Added a decorator to enable dynamic substitution in docstrings. |
| tux/cogs/fun/fact.py | Refactored the fun fact command with category support and improved docs. |
Comments suppressed due to low confidence (1)
tux/cogs/fun/fact.py:103
- [nitpick] Consider using named placeholders in the docstring instead of a single unnamed {0} to improve clarity and maintainability of the substitution.
@docstring_parameter(f"Available categories: {', '.join([ft.value for ft in FactType])}. Default category is {FactType.RANDOM.value}.",)
will make a issue and handle that soon so i can also try and see if anything else needs moving |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR improves the fun facts command by organizing facts into multiple categories, enhancing user interaction, and expanding the repository of fun facts.
- Introduces FactType enum and separate fact lists (linux, cat, tux, random)
- Updates the command interface to support category selection via hybrid and slash commands
- Adds a docstring_parameter decorator for dynamic docstring formatting
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tux/utils/functions.py | Added a decorator for dynamic docstring formatting |
| tux/cogs/fun/fact.py | Refactored fact command to support multiple categories and improved docs |
Comments suppressed due to low confidence (1)
tux/cogs/fun/fact.py:102
- [nitpick] Consider clarifying the usage of the docstring substitution placeholder '{0}' in the function's docstring so that it clearly maps to the provided dynamic content. This will improve readability and maintainability.
@docstring_parameter(f"Available categories: {', '.join([ft.value for ft in FactType])}. Default category is {FactType.RANDOM.value}.",)
Description
adds more categories to facts so its not just linux focused
#854
Summary by Sourcery
Improve the fun facts command by organizing facts into multiple categories, expanding its content, and enabling users to retrieve facts by category through both prefix and slash command interfaces.
New Features:
Enhancements: