28
28
import net .dv8tion .jda .api .EmbedBuilder ;
29
29
import net .dv8tion .jda .api .components .actionrow .ActionRow ;
30
30
import net .dv8tion .jda .api .components .buttons .Button ;
31
- import net .dv8tion .jda .api .components .buttons .ButtonStyle ;
32
31
import net .dv8tion .jda .api .components .container .Container ;
33
32
import net .dv8tion .jda .api .components .separator .Separator ;
34
33
import net .dv8tion .jda .api .components .textdisplay .TextDisplay ;
@@ -80,6 +79,15 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {
80
79
// Create a thread for the exploit report
81
80
ThreadChannel reportThread = event .getChannel ().asTextChannel ().createThreadChannel (title , true ).complete ();
82
81
82
+ if (reportThread == null ) {
83
+ event .replyEmbeds (new EmbedBuilder ()
84
+ .setTitle ("Error" )
85
+ .setDescription ("Failed to create a thread for the exploit report. Please try again later." )
86
+ .setColor (BotColors .FAILURE .getColor ())
87
+ .build ()).setEphemeral (true ).queue ();
88
+ return ;
89
+ }
90
+
83
91
reportThread .sendMessageEmbeds (new EmbedBuilder ()
84
92
.setTitle (title )
85
93
.setDescription (description )
@@ -103,6 +111,15 @@ public void onModalInteraction(@NotNull ModalInteractionEvent event) {
103
111
.queue ();
104
112
}
105
113
106
- event .reply ("Thank you for reporting the exploit! We have created a thread for you at " + reportThread .getJumpUrl ()).setEphemeral (true ).queue ();
114
+ event .replyComponents (Container .of (
115
+ TextDisplay .of ("## Exploit Report Created" ),
116
+ TextDisplay .of ("Your exploit report has been successfully created." ),
117
+ TextDisplay .of ("Thank you for helping us improve Geyser!" ),
118
+ Separator .createDivider (Separator .Spacing .SMALL ),
119
+ ActionRow .of (Button .link (reportThread .getJumpUrl (), "Go to thread" ))
120
+ ).withAccentColor (BotColors .SUCCESS .getColor ()))
121
+ .setEphemeral (true )
122
+ .useComponentsV2 ()
123
+ .queue ();
107
124
}
108
125
}
0 commit comments