[Trivia] Add support for payout to multiple trivia winners #4649
No reviewers
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!4649
Loading…
Reference in a new issue
No description provided.
Delete branch "V3/develop"
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?
Type
Description of the changes
This PR is for issue #3931. These changes allow for more than one winner of the trivia game. Each winner will receive an even split of the payout. This also adds a new message to congratulate the winner(s).
I've tested it out on my own, but is any additional QA recommended? Not really sure how to unit test this using pytest.
There's no need for making unit tests here, PRs are reviewed by one of our Core Dev/QA members.
This is a really clean solution, the code also seems more readable than what's been there before 😄
The new functionality appears to work fine however, I got a few review comments before I can approve this.
@ -281,42 +281,57 @@ class TriviaSession:channel = self.ctx.channelLOG.debug("Force stopping trivia session; #%s in %s", channel, channel.guild.id)According to our style guide, the fact that empty sequences evaluate to false should be used instead of
len()(you can see PEP 8 for more information)There's a few things with how this message is defined that need to be changed:
_()is a call to Translator object defined at the top of the file and is needed in order for the string to be translated when there's a translated version available..join(), we have ahumanize_list()utility function that formats a list according to formatting rules of the locale in use.{plural}format field.Since this is not a public API, it would be clearer if this got renamed to
pay_winners()and the usage of it got updated appropriately.I went ahead and made the appropriate changes on my own and this is now ready to be merged.
Thanks for your contribution!