Skip to content
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

add deactivate_buttons() to Paginators #1682

Closed
wants to merge 1 commit into from

Conversation

Donbur4156
Copy link
Contributor

Pull Request Type

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

Description

add function to deactivate Control Buttons in a Paginator. To reduce 5 Lines of Code to 2 to switch from Buttons to select.

Changes

  • add function "deactivate_buttons()" to Paginator Class

Related Issues

#1681

Test Scenarios

  1. create Paginator
  2. activate Select Menu
  3. deactivate Buttons via function
  4. send Paginator

Python Compatibility

  • I've ensured my code works on Python 3.10.x
  • I've ensured my code works on Python 3.11.x
    not testet with 3.11, but changes should not break this.

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

add function to deactivate Control Buttons in a Paginator.
To reduce 5 Lines of Code to 2 to switch from Buttons to select.

Signed-off-by: Donbur4156 <janpfister@t-online.de>
@AstreaTSS
Copy link
Member

I'm... not actually sure if this is really useful, honestly. This seems like a niche usecase that isn't done terribly often, and it's only a few lines of code.

@mifuyutsuki
Copy link
Contributor

If the purpose of this feature is to change a few default attributes... Yeah, I don't think it warrants creating a whole method. And the method name deactivate_buttons() itself appears like it's meant to disable the buttons of an already sent paginator, which is the purpose of Paginator.stop().

If you use that "show select menu only" pattern often in your bot code, you might have better luck creating a subclass of Paginator with the relevant attributes overridden. Otherwise, I would be perfectly fine with the extra few lines for explicit readability.

@Donbur4156
Copy link
Contributor Author

Ok, it was just an idea to simplify the bot code.
If you don't want to implement this I would be fine with it and you can close PR and Feature request.

@AstreaTSS AstreaTSS closed this May 21, 2024
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.

None yet

3 participants