2020
2121import com .jagrosh .jdautilities .command .SlashCommandEvent ;
2222import io .codemc .bot .CodeMCBot ;
23+ import net .dv8tion .jda .api .components .label .Label ;
24+ import net .dv8tion .jda .api .components .textinput .TextInput ;
25+ import net .dv8tion .jda .api .components .textinput .TextInputStyle ;
2326import net .dv8tion .jda .api .entities .Guild ;
2427import net .dv8tion .jda .api .entities .Member ;
2528import net .dv8tion .jda .api .entities .MessageEmbed ;
2629import net .dv8tion .jda .api .interactions .InteractionHook ;
27- import net .dv8tion .jda .api .interactions .components .ActionRow ;
28- import net .dv8tion .jda .api .interactions .components .text .TextInput ;
29- import net .dv8tion .jda .api .interactions .components .text .TextInputStyle ;
30- import net .dv8tion .jda .api .interactions .modals .Modal ;
30+ import net .dv8tion .jda .api .modals .Modal ;
3131
3232public class CmdSubmit extends BotCommand {
3333
@@ -45,31 +45,33 @@ public void withHookReply(InteractionHook hook, SlashCommandEvent event, Guild g
4545
4646 @ Override
4747 public void withModalReply (SlashCommandEvent event ){
48- TextInput user = TextInput .create ("user" , "GitHub Username" , TextInputStyle .SHORT )
48+ TextInput user = TextInput .create ("user" , TextInputStyle .SHORT )
4949 .setPlaceholder ("CodeMC" )
5050 .setRequired (true )
5151 .build ();
52- TextInput repo = TextInput .create ("repo" , "Repository Name" , TextInputStyle .SHORT )
52+ Label userLabel = Label .of ("GitHub Username" , user );
53+
54+ TextInput repo = TextInput .create ("repo" , TextInputStyle .SHORT )
5355 .setPlaceholder ("Bot" )
5456 .setRequired (true )
5557 .build ();
56- TextInput repoLink = TextInput .create ("repoLink" , "Repository Link (Leave blank if on GitHub)" , TextInputStyle .SHORT )
58+ Label repoLabel = Label .of ("Repository Name" , repo );
59+
60+ TextInput repoLink = TextInput .create ("repoLink" , TextInputStyle .SHORT )
5761 .setPlaceholder ("https://git.example.com/CodeMC/Bot" )
5862 .setRequired (false )
5963 .build ();
60- TextInput description = TextInput .create ("description" , "Description" , TextInputStyle .PARAGRAPH )
64+ Label repoLinkLabel = Label .of ("Repository Link (Leave blank if on GitHub)" , repoLink );
65+
66+ TextInput description = TextInput .create ("description" , TextInputStyle .PARAGRAPH )
6167 .setPlaceholder ("Discord Bot for the CodeMC Server." )
6268 .setRequired (true )
6369 .setMaxLength (MessageEmbed .VALUE_MAX_LENGTH )
6470 .build ();
71+ Label descriptionLabel = Label .of ("Project Description" , description );
6572
6673 Modal modal = Modal .create ("submit" , "Join Request" )
67- .addComponents (
68- ActionRow .of (user ),
69- ActionRow .of (repo ),
70- ActionRow .of (repoLink ),
71- ActionRow .of (description )
72- )
74+ .addComponents (userLabel , repoLabel , repoLinkLabel , descriptionLabel )
7375 .build ();
7476
7577 event .replyModal (modal ).queue ();
0 commit comments