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 8 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.

@christolis christolis force-pushed the feature/application-form branch 2 times, most recently from cb7815a to 042a0e0 Compare April 4, 2024 09:48
@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?

@christolis
Copy link
Member Author

@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?

The generated form is persistent and used by everybody. It does not need to be recreated by whoever has the MANAGE_ROLES permission. As for updating it, that's right. Currently, the way it is developed, the message has to be deleted and get the command executed again, which is not that big of a problem considering the rarity of updating such form.

Copy link
Contributor

@surajkumar surajkumar left a comment

Choose a reason for hiding this comment

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

Great PR and the thought put into the development of the feature is evident.

Please can you look into the comments, additionally, there are some duplicate checks happening e.g. multiple guild == null checks. This can be done once much earlier and then you don't have to worry about it.

@christolis christolis force-pushed the feature/application-form branch 2 times, most recently from 41c3edd to 5542289 Compare October 17, 2024 19:54
Co-authored-by: Suraj Kumar <76599223+surajkumar@users.noreply.github.com>
This removes the permission check for the bot to have the `MANAGE_ROLES`
permission in order to execute the command.
tj-wazei
tj-wazei previously approved these changes Oct 17, 2024
Copy link

@tj-wazei tj-wazei left a comment

Choose a reason for hiding this comment

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

LGTM!

tj-wazei
tj-wazei previously approved these changes Oct 17, 2024
Copy link
Member

@SquidXTV SquidXTV left a comment

Choose a reason for hiding this comment

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

Thanks for your effort <3

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: In Review
Development

Successfully merging this pull request may close these issues.

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