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

Feat: Add slash command to generate application form for various community roles #1049

Open
wants to merge 12 commits into
base: develop
Choose a base branch
from

Conversation

christolis
Copy link
Member

@christolis christolis commented Mar 8, 2024

Closes #1024.

Screenshots

ScreenRecording2024-03-11at18 29 35-ezgif com-video-to-gif-converter
image

Configuration changes

Property Description Type Default
applicationForm.applicationChannelPattern Where submitted
applications end up.
String "applications-log"

TODO

  • Add a 5 minute cooldown per member for sending applications to prevent spam (feel free to recommend alternatives).
    • This could be done by having a HashMap<Member, OffsetDateTime> where the key is the Member who sent an application and the value is the date and time that they sent it. There should be a condition every time a Member attempts to send any application which utilizes the aforementioned HashMap to prevent spam.
  • Add JavaDocs for every method where it's necessary.
  • Switch to EntitySelectInteractionEvent for the dropdown menu. (EDIT: Impossible since this would forcibly include all existing roles)
  • Move selectable roles from the config to the command parameters in a similar fashion with previous commands.
    • This eliminates emoji/description metadata as well that was previously defined in the configuration file.

@christolis christolis added enhancement New feature or request new command Add a new command or group of commands to the bot priority: major labels Mar 8, 2024
@christolis christolis self-assigned this Mar 8, 2024
@Suleman70
Copy link
Member

Can i be assigned to this?

@christolis christolis marked this pull request as ready for review March 9, 2024 10:17
@christolis christolis requested a review from a team as a code owner March 9, 2024 10:17
@Suleman70 Suleman70 removed their assignment Mar 16, 2024
Copy link
Member

@Taz03 Taz03 left a comment

Choose a reason for hiding this comment

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

branch update is required, it is using removed APIs

@christolis christolis marked this pull request as draft March 19, 2024 22:16
@christolis
Copy link
Member Author

Marked PR as draft since there needs to be some rework on certain things which will be specified in the TODO.

After a discussion with the rest of the team, we decided that there are
plenty of flaws with having application roles stored in the
configuration file, primarily due to the fact that if somebody were to
want to change the roles displayed on the dropdown menu, they would have
to perform the tedious work of updating the configuration and then
restarting the server, but we can do better.

With this commit, all the application roles are inferred straight from
the arguments that are passed from the member executing the command. A
restart will not be needed in case somebody wants to change the
available roles or add a new one.
This way we are able to add more roles in the future without running
into any character limits. Getting the last character of the menu option
ID is not the most effective way to go about this.

Adding the delimiter in the menu option IDs allows us to treat the ID of
the role better and in a safer way.
@christolis christolis marked this pull request as ready for review April 4, 2024 22:12
@christolis christolis requested a review from Taz03 April 4, 2024 22:18
@ankitsmt211 ankitsmt211 added the config-changes if your PR contains any changes related to config file label May 18, 2024
@ankitsmt211
Copy link
Member

@christolis what happens to the generated form after x user applies through form? Does the form need to be re-created? Or is it only unavailable for x user to a certain time period?

Also how do we update the form if need be?
Delete message and recreate?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
config-changes if your PR contains any changes related to config file enhancement New feature or request new command Add a new command or group of commands to the bot priority: major
Projects
Status: Ready For Review
Development

Successfully merging this pull request may close these issues.

Add slash command to generate application form for various community roles
4 participants