2929import org .slf4j .LoggerFactory ;
3030
3131import org .togetherjava .tjbot .config .ApplicationFormConfig ;
32- import org .togetherjava .tjbot .config .ApplyRoleConfig ;
3332import org .togetherjava .tjbot .config .Config ;
3433import org .togetherjava .tjbot .features .CommandVisibility ;
3534import org .togetherjava .tjbot .features .SlashCommandAdapter ;
@@ -69,7 +68,6 @@ public class ApplicationCreateCommand extends SlashCommandAdapter {
6968
7069 private final Cache <Member , OffsetDateTime > applicationSubmitCooldown ;
7170 private final Predicate <String > applicationChannelPattern ;
72- private final ApplicationFormConfig config ;
7371
7472 /**
7573 * Constructs a new {@link ApplicationCreateCommand} with the specified configuration.
@@ -82,9 +80,9 @@ public ApplicationCreateCommand(Config config) {
8280 super ("application-form" , "Generates an application form for members to apply for roles." ,
8381 CommandVisibility .GUILD );
8482
85- this . config = config .getApplicationFormConfig ();
83+ final ApplicationFormConfig formConfig = config .getApplicationFormConfig ();
8684 this .applicationChannelPattern =
87- Pattern .compile (this . config .applicationChannelPattern ()).asMatchPredicate ();
85+ Pattern .compile (formConfig .applicationChannelPattern ()).asMatchPredicate ();
8886
8987 this .applicationSubmitCooldown = Caffeine .newBuilder ()
9088 .expireAfterWrite (APPLICATION_SUBMIT_COOLDOWN , TimeUnit .MINUTES )
@@ -132,23 +130,6 @@ public void onSlashCommand(SlashCommandInteractionEvent event) {
132130 sendMenu (event );
133131 }
134132
135- /**
136- * Maps a user and an {@link ApplyRoleConfig} option to a SelectOption object.
137- * <p>
138- * This method is used to create a {@link SelectOption} object that represents a role
139- * configuration option for a user, including a unique component ID generated based on the
140- * user's ID and the option's name, a description, and an emoji.
141- *
142- * @param user the user for whom the role configuration option is being mapped
143- * @param option the {@link ApplyRoleConfig} option to be mapped to a {@link SelectOption}
144- * @return a {@link SelectOption} object with the specified details
145- */
146- private SelectOption mapToSelectOption (User user , ApplyRoleConfig option ) {
147- return SelectOption .of (option .name (), generateComponentId (user .getId (), option .name ()))
148- .withDescription (option .description ())
149- .withEmoji (Emoji .fromFormatted (option .emoji ()));
150- }
151-
152133 @ Override
153134 public void onStringSelectSelection (StringSelectInteractionEvent event , List <String > args ) {
154135 SelectOption selectOption = event .getSelectedOptions ().getFirst ();
@@ -242,10 +223,9 @@ private void addRolesToMenu(StringSelectMenu.Builder menuBuilder,
242223 }
243224 });
244225
245- roles .values ().forEach (role -> {
246- menuBuilder .addOption (role .getLabel (), role .getValue (), role .getDescription (),
247- role .getEmoji ());
248- });
226+ roles .values ()
227+ .forEach (role -> menuBuilder .addOption (role .getLabel (), role .getValue (),
228+ role .getDescription (), role .getEmoji ()));
249229 }
250230
251231 @ Override
0 commit comments