Implement [p]trivia info and add DESCRIPTION to trivia schema #5897
Labels
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
Mrcoolgamer11/Red-DiscordBot!5897
Loading…
Reference in a new issue
No description provided.
Delete branch "trivia-info-and-description-key"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Description of the changes
Adds a new command,
[p]trivia info <category>, as well as a newDESCRIPTIONkey to the trivia list schema.DESCRIPTIONis an optional key, just likeAUTHOR.DESCRIPTIONwill appear only in[p]trivia infoas 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
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...
@ -41,12 +41,33 @@ If there are multiple authors, we can separate them with commas.Multi-line plain scalars can be a foot gun, I think it's better to just show usage of block scalars:
(also did a slight rewording because the tenses seemed inconsistent)
Empty / whitespace-only string needs to be handled because we will have an empty string passed as the field value otherwise. Furthermore, placeholder text should be translated.
Empty / whitespace-only string needs to be handled because we will have an empty string passed as the field value otherwise. Furthermore, placeholder text should be translated.
Also, though I'm not sure about this, I think "Author" should be "Authors" as there can also be multiple authors in the
AUTHORfield.This should be a translatable string.
This should instead use names used in
[p]triviaset showsettingsas the current implementation doesn't work well with translations and it uses not necessarily clearly-phrased key names in user-facing output.I do wonder if we really should be showing the whole configuration rather than just the actual overrides.
I suppose " (default)" or something similar could be appended to the value of each setting if the setting remains the same as the default setting
I suppose. But is there much benefit to showing the configuration that hasn't changed? I guess it's true that regular users can't use
[p]triviaset showsettingsto see the default configuration but does it matter?I guess not, they'd just remain unaware of any underlying setting changes in the guild's config that override trivia defaults. Though I don't really see that as a problem myself
I went ahead and resolved the conflict caused by #5947, the change related to only showing actual overrides still appears to need some changes. I left a review comment that should explain how I envision it to look.
This needs to be modified so that each line about the configuration only gets added if the appropriate override is present.
One way to do this would be to create a dictionary mapping key names to translated strings with a common placeholder (e.g.
{value}) and formatting the value into them.Just to mention it,
config_settingsis no longer defined but, that should get resolved once you make the change requested here.Do you think it would be worth adding simple
DESCRIPTIONs to each of the existing trivia lists in data/lists?I suppose it would be nice.
I pushed a commit that makes setting formatting fully consistent between
[p]triviaset showsettingsand[p]trivia infoby splitting it out into a separate function. Additionally, I've made some small changes in regard to the formatting of bools (now formatted as "Yes" and "No" which also required a small adjustment to some of the setting names) and numbers (they're humanized now, and the timespan-related values (delay, timeout) are now suffixed with " seconds", same as in[p]triviaset showsettings).Other than that, I removed
lang="yaml"as it didn't really render properly, though I suppose we could try altering the formatting andlanga bit so that it does. I figured it's not a requirement though.@ -1,4 +1,5 @@AUTHOR: JennJennMissing full stop, "year of" doesn't seem to be correct grammar:
https://english.stackexchange.com/questions/306301/in-the-year-2016-in-the-year-of-2016-of-the-year-2016
https://english.stackexchange.com/questions/8788/in-the-year-1908-or-in-the-year-of-1908
@ -1,4 +1,5 @@AUTHOR: JennJennMissing full stop, "year of" doesn't seem to be correct grammar:
https://english.stackexchange.com/questions/306301/in-the-year-2016-in-the-year-of-2016-of-the-year-2016
https://english.stackexchange.com/questions/8788/in-the-year-1908-or-in-the-year-of-1908
@ -1,4 +1,5 @@AUTHOR: Tajniak96Missing full stop.
@ -1,4 +1,5 @@AUTHOR: MamalusMaybe mention that it's about chemical elements? Maybe it's just me (I'm not a native English speaker) but it may not be immediately clear what "elements" this is about.
@ -1,4 +1,5 @@AUTHOR: bobloy@ -1,4 +1,5 @@AUTHOR: KaiGucci (kidsterz)@ -1,4 +1,5 @@AUTHOR: Lemon (inthedark.org#0666)@ -1,4 +1,5 @@AUTHOR: Mahlss & Fjall@ -1,4 +1,7 @@AUTHOR: aikaternaTo my knowledge, each of the
whosthatpokemontrivia lists is about a specific Generation of pokemons, i.e.whosthatpokemonis about Generation I,whosthatpokemon2is about Generation II, and so on. It would be good if this description included information about the generation it's about.A passing thought I had - it could be useful to have a way to see a list of trivia categories with their descriptions. I feel like it could make the output of
[p]trivia listtoo long though so I don't think we should really do anything about this thought of mine but I did want to at least bring it up here :PThat's a neat idea, I feel it would be a suitable feature if it was implemented just like [p]cc list, so you could flick through a menu
Yeah, I'm just wondering if doing that in the existing command wouldn't make it harder to look through available categories since they wouldn't all fit on one page? Maybe it's a non-issue.
For me personally I wouldn't see that as an issue, as the menus are indicative that you can view further categories on subsequent pages. 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.@ -1,4 +1,5 @@AUTHOR: MamalusI agree with this, thanks
@ -1,4 +1,7 @@AUTHOR: aikaternaI see, I wasn't aware of this so thanks for letting me know. I'll make those changes
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.
Probably not worth it, let's just assume nobody cares about seeing a compact version of the category list.
#5565 has been merged, this requires some changes now
Hi, just reminding you that this PR is waiting on the addition of descriptions to the
[p]trivia listcommand 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.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!