Skip to content

Fuzz duck time, add admin only next command #1297

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

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open

Conversation

ajax146
Copy link
Contributor

@ajax146 ajax146 commented May 2, 2025

This adds a +-10% fuzz to the duck time, and creates an admin only command to view the time the next duck is coming for the guild.

Due to limitations of the loop cog, it's currently not possible to do by channel specifically, so if there is more than one duck hunt channel this feature will be totally broken.

@ajax146 ajax146 requested review from a team, dkay0670 and GalacticalWolf and removed request for a team May 2, 2025 14:14
@ajax146 ajax146 added Waiting for Review PR: Want for next release This PR should be merged prior to the next release labels May 2, 2025
@dkay0670 dkay0670 requested a review from Copilot May 4, 2025 02:01
Copy link
Contributor

@Copilot Copilot AI left a 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 adds an admin-only command to display when the next duck will spawn and updates the duck wait function to include a ±10% fuzz to the duck time.

  • Introduces a new app_commands group command "next" under the duck command group.
  • Updates the wait function to compute a fuzzed wait time before duck appearance.
  • Adds the required import for app_commands.


fuzzed_min = int(min_wait * random.uniform(0.9, 1.1))
fuzzed_max = int(max_wait * random.uniform(0.9, 1.1))

Copy link
Preview

Copilot AI May 4, 2025

Choose a reason for hiding this comment

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

The independent fuzzing of min_wait and max_wait may result in fuzzed_min being greater than fuzzed_max, potentially causing random.randint to throw an error. Consider ensuring that the lower bound is always less than or equal to the upper bound.

Suggested change
if fuzzed_min > fuzzed_max:
fuzzed_min, fuzzed_max = fuzzed_max, fuzzed_min

Copilot uses AI. Check for mistakes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Extension: Duck PR: Want for next release This PR should be merged prior to the next release Waiting for Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants