Skip to content
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

Implement [p]trivia info and add DESCRIPTION to trivia schema #5897

Merged

Conversation

Kreusada
Copy link
Member

@Kreusada Kreusada commented Nov 2, 2022

Description of the changes

Adds a new command, [p]trivia info <category>, as well as a new DESCRIPTION key to the trivia list schema.
DESCRIPTION is an optional key, just like AUTHOR. DESCRIPTION will appear only in [p]trivia info as of now.

The idea came from @japandotorg in the Red server. If this PR is accepted and merged, #5565 will need to be updated to include this new key.

Fixes #3978

Don't be alarmed by the number of files changed, this PR is also adding DESCRIPTION keys to existing core lists and there are only a few files where code has been changed

Have the changes in this PR been tested?

Yes

@github-actions github-actions bot added Category: Docs - Other This is related to documentation that doesn't have its dedicated label. Category: Cogs - Trivia This is related to the Trivia cog. labels Nov 2, 2022
@Flame442 Flame442 added the Type: Enhancement Something meant to enhance existing Red features. label Nov 17, 2022
@Jackenmen Jackenmen added this to the 3.5.1 milestone Dec 28, 2022
@Jackenmen
Copy link
Member

The example given for the description of logo trivia in the guide kind of makes me want to show the description in the startup message (as sort of an introduction) but that wouldn't really work when multiple trivia lists are selected, oh well...

docs/guide_trivia_list_creation.rst Outdated Show resolved Hide resolved
docs/guide_trivia_list_creation.rst Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
redbot/cogs/trivia/trivia.py Outdated Show resolved Hide resolved
@Jackenmen Jackenmen self-assigned this Dec 29, 2022
@Jackenmen
Copy link
Member

For me personally I wouldn't see that as an issue

Feel free to go ahead with it then. I don't really have any suggestions on how this should look, do whatever you think will look good I guess.

Unless, an argument were to be added similar to [p]serverinfo, where you can customise the detail shown in the command, maybe defaulting to True (show descriptions), but have the False option to view the list how we would view them as it stands.

Probably not worth it, let's just assume nobody cares about seeing a compact version of the category list.

@Jackenmen
Copy link
Member

#5565 has been merged, this requires some changes now

@github-actions github-actions bot removed the Category: Docs - Other This is related to documentation that doesn't have its dedicated label. label Mar 3, 2023
@github-actions github-actions bot added the Category: Meta This is related to the repository maintenance. label Mar 3, 2023
@Jackenmen
Copy link
Member

Hi, just reminding you that this PR is waiting on the addition of descriptions to the [p]trivia list command with proper pagification that would replace the current comma-separated list.

@Jackenmen Jackenmen modified the milestones: 3.5.6, 3.5.7 Mar 18, 2024
@Kreusada
Copy link
Member Author

Hi, just reminding you that this PR is waiting on the addition of descriptions to the [p]trivia list command with proper pagification that would replace the current comma-separated list.

I've managed a quick implementation through using the get_trivia_list() method. However, this isn't ideal at all as it requires opening each trivia list file through the iteration, making the command slow to produce output. It may be worth caching the trivia lists on cog load so that the dictionaries are then always available without opening their files. I thought that may have been out of scope for this PR though, I'd be interested to hear your opinion on this.

Copy link
Member

@Jackenmen Jackenmen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've managed a quick implementation through using the get_trivia_list() method. However, this isn't ideal at all as it requires opening each trivia list file through the iteration, making the command slow to produce output

I see, I didn't realize this will become a concern here. While I do think we should pursue this, I don't want to make this PR's approval contingent on this change. I went ahead and added missing descriptions for recently added trivias, moved the length check to schema, and made some other small chore changes. Thanks for contributing!

@Jackenmen Jackenmen merged commit 48d7471 into Cog-Creators:V3/develop Mar 31, 2024
17 checks passed
@red-githubbot red-githubbot bot added the Changelog Entry: Pending Changelog entry for this PR hasn't been added by repo maintainers yet. label Mar 31, 2024
@Jackenmen Jackenmen modified the milestones: 3.5.9, 3.5.8 Mar 31, 2024
@Jackenmen Jackenmen added Changelog Entry: Added Changelog entry for this PR has already been added to changelog PR. and removed Changelog Entry: Pending Changelog entry for this PR hasn't been added by repo maintainers yet. labels Mar 31, 2024
Dav-Git pushed a commit to Dav-Git/Red-DiscordBot that referenced this pull request Sep 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Category: Cogs - Trivia - Lists Changing or adding trivia lists. Category: Cogs - Trivia This is related to the Trivia cog. Category: Meta This is related to the repository maintenance. Changelog Entry: Added Changelog entry for this PR has already been added to changelog PR. Type: Enhancement Something meant to enhance existing Red features.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Trivia] Show custom trivia overrides
3 participants