-
Notifications
You must be signed in to change notification settings - Fork 17
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
base: main
Are you sure you want to change the base?
Conversation
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 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)) | ||
|
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.
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.
if fuzzed_min > fuzzed_max: | |
fuzzed_min, fuzzed_max = fuzzed_max, fuzzed_min |
Copilot uses AI. Check for mistakes.
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.