File tree Expand file tree Collapse file tree 1 file changed +1
-7
lines changed
src/main/java/net/javadiscord/javabot/systems/commands Expand file tree Collapse file tree 1 file changed +1
-7
lines changed Original file line number Diff line number Diff line change 1313import net .javadiscord .javabot .command .interfaces .SlashCommand ;
1414import org .json .JSONException ;
1515
16- import java .io .UnsupportedEncodingException ;
1716import java .net .URLEncoder ;
1817import java .nio .charset .StandardCharsets ;
1918import java .time .Instant ;
@@ -36,12 +35,7 @@ public class ChangeMyMindCommand implements SlashCommand {
3635 public ReplyCallbackAction handleSlashCommandInteraction (SlashCommandInteractionEvent event ) {
3736 var hook = event .getHook ();
3837 String encodedSearchTerm ;
39- try {
40- encodedSearchTerm = URLEncoder .encode (Objects .requireNonNull (event .getOption ("text" )).getAsString (), StandardCharsets .UTF_8 .toString ());
41- } catch (UnsupportedEncodingException e ) {
42- e .printStackTrace ();
43- return event .reply ("The text you provided is using an unsupported encoding." );
44- }
38+ encodedSearchTerm = URLEncoder .encode (Objects .requireNonNull (event .getOption ("text" )).getAsString (), StandardCharsets .UTF_8 );
4539 if (encodedSearchTerm .toCharArray ().length > MAX_SEARCH_TERM_LENGTH ) {
4640 return event .reply ("The text you provided is too long. It may not be more than " + MAX_SEARCH_TERM_LENGTH + " characters." );
4741 }
You can’t perform that action at this time.
0 commit comments