File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
src/main/java/net/javadiscord/javabot/systems/user_commands/format_code Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change 99import net .dv8tion .jda .api .interactions .commands .build .OptionData ;
1010import net .dv8tion .jda .api .interactions .components .ActionRow ;
1111import net .dv8tion .jda .api .interactions .components .buttons .Button ;
12+ import net .javadiscord .javabot .util .Checks ;
1213import net .javadiscord .javabot .util .InteractionUtils ;
1314import net .javadiscord .javabot .util .Responses ;
1415import net .javadiscord .javabot .util .StringUtils ;
@@ -82,6 +83,10 @@ public void execute(@NotNull SlashCommandInteractionEvent event) {
8283 }
8384 });
8485 } else {
86+ if (Checks .isInvalidLongInput (idOption )) {
87+ Responses .error (event , "Please provide a valid message id!" ).queue ();
88+ return ;
89+ }
8590 long messageId = idOption .getAsLong ();
8691 event .getChannel ().retrieveMessageById (messageId ).queue (
8792 target -> event .getHook ().sendMessageFormat ("```%s\n %s\n ```" , format , StringUtils .standardSanitizer ().compute (target .getContentRaw ()))
You can’t perform that action at this time.
0 commit comments