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

Too many roles bugfix role-select #404

Merged
merged 8 commits into from
Jun 1, 2022

Conversation

Tais993
Copy link
Member

@Tais993 Tais993 commented Mar 1, 2022

Overview

This fixes the bug with /role-select crashing on servers having too many roles. And by that closes #400 .

It is done by redesigning the command. Instead of having two dialogs (one for the moderator to create the actual dialog and one final for the user to pick), the moderator now picks their options directly as arguments to the command.

creation
dialog
dialog selection
result

Helper

While at it, we introduced a little helper method to SlashCommandAdapter:

  • generateMultipleOptions and
  • getMultipleOptionsByNamePrefix

Former basically takes a given option, such as "foo" and create a list of optional options:

  • "foo1"
  • "foo2"
  • "foo3"
  • ...

And latter can parse that back conveniently.

@Tais993 Tais993 added bug Something isn't working enhance command Modify or improve an existing command or group of commands of the bot priority: major labels Mar 1, 2022
@Tais993 Tais993 added this to the Migrate existing commands milestone Mar 1, 2022
@Tais993 Tais993 self-assigned this Mar 1, 2022
@Tais993 Tais993 changed the title Fixes role-select command crashing if the server has too many roles Vararg support & too many roles bugfix role-select Mar 1, 2022
@Tais993 Tais993 force-pushed the bugfix/role-select-too-many-roles branch 4 times, most recently from 88671d5 to b9392fc Compare March 1, 2022 16:17
@sonarcloud
Copy link

sonarcloud bot commented Mar 1, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Tais993 Tais993 marked this pull request as ready for review March 2, 2022 06:57
@Tais993 Tais993 requested review from a team as code owners March 2, 2022 06:57
@Tais993 Tais993 changed the title Vararg support & too many roles bugfix role-select Too many roles bugfix role-select Mar 3, 2022
@Zabuzard
Copy link
Member

any blockers here, or just missing time?

@Tais993
Copy link
Member Author

Tais993 commented Mar 31, 2022

Mainly forgotten about it, and besides that I don't have a lot of free time so yea, someone else can take over if they want, otherwise I'll take a look when I have the time / finished some other things.

@github-actions
Copy link

github-actions bot commented May 1, 2022

This pull request is stale because it has been open 30 days with no activity. Remove stale label, comment or add the valid label or this will be closed in 5 days.

@github-actions github-actions bot added the stale label May 1, 2022
@Zabuzard Zabuzard removed the stale label May 2, 2022
@Zabuzard Zabuzard self-assigned this May 27, 2022
@Zabuzard Zabuzard force-pushed the bugfix/role-select-too-many-roles branch from b9392fc to edf680a Compare May 27, 2022 13:44
@sonarcloud
Copy link

sonarcloud bot commented May 28, 2022

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@Zabuzard Zabuzard requested review from marko-radosavljevic and a team May 28, 2022 11:06
@Zabuzard Zabuzard requested a review from a team May 28, 2022 11:06
@Zabuzard
Copy link
Member

Noice. Merging tomorrow, after doing the mini release.

@Zabuzard Zabuzard merged commit 15c0115 into develop Jun 1, 2022
@Zabuzard Zabuzard deleted the bugfix/role-select-too-many-roles branch June 1, 2022 07:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working enhance command Modify or improve an existing command or group of commands of the bot priority: major
Projects
None yet
Development

Successfully merging this pull request may close these issues.

/role-select crashes if server has too many roles
3 participants