Skip to content

Commit

Permalink
switch to usage of url instead of string
Browse files Browse the repository at this point in the history
  • Loading branch information
Snabeldier committed Jan 6, 2025
1 parent 5f140ed commit e5bc9e1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/main/java/minevalley/core/api/Core.java
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.net.URL;
import java.sql.SQLException;
import java.text.SimpleDateFormat;
import java.time.DayOfWeek;
Expand Down Expand Up @@ -1179,7 +1180,7 @@ public static Reminder createReminder(@Nonnegative int hours, @Nonnegative int m
* @throws IllegalArgumentException if the URL is null
*/
@Nonnull
public static Webhook createWebhook(@Nonnull String url) throws IllegalArgumentException {
public static Webhook createWebhook(@Nonnull URL url) throws IllegalArgumentException {
return server.createWebhook(url);
}

Expand Down
3 changes: 2 additions & 1 deletion src/main/java/minevalley/core/api/CoreServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@
import javax.annotation.Nonnegative;
import javax.annotation.Nonnull;
import javax.annotation.Nullable;
import java.net.URL;
import java.sql.SQLException;
import java.time.DayOfWeek;
import java.util.List;
Expand Down Expand Up @@ -261,7 +262,7 @@ public interface CoreServer {
Reminder createReminder(int hours, int minutes, @Nonnull Runnable callback, List<DayOfWeek> weekdays) throws IllegalArgumentException;

@Nonnull
Webhook createWebhook(@Nonnull String url) throws IllegalArgumentException;
Webhook createWebhook(@Nonnull URL url) throws IllegalArgumentException;

@Nonnull
EmbeddedMessage createEmbeddedMessage();
Expand Down

0 comments on commit e5bc9e1

Please sign in to comment.