Skip to content

Conversation

AstreaTSS
Copy link
Member

Pull Request Type

  • Feature addition
  • Bugfix
  • Documentation update
  • Code refactor
  • Tests improvement
  • CI/CD pipeline enhancement
  • Other: [Replace with a description]

Description

This PR fixes an issue where numeric options with min_value or max_value incorrectly errored out when using prefixed command variants of hybrid commands. Oops 😅.

Changes

  • Do not pass in ctx when converting a string to a number for RangeConverter.

Related Issues

Test Scenarios

@hybrid_slash_command()
@slash_option(
    "option",
    description="An integer option",
    opt_type=OptionType.INTEGER,
    required=True,
    min_value=1,
    max_value=10,
)
async def test(ctx: HybridContext, option: int):
    await ctx.send(f"Option: {option}")

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x

Checklist

  • I've run the pre-commit code linter over all edited files
  • I've tested my changes on supported Python versions
  • I've added tests for my code, if applicable
  • I've updated / added documentation, where applicable

@silasary silasary merged commit c7745be into unstable Sep 24, 2025
9 of 12 checks passed
@silasary silasary deleted the hybrid-range-fix branch September 24, 2025 02:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants