Skip to content

Commit

Permalink
Allow UserSnowflake subtypes in bulk ban methods (#2689)
Browse files Browse the repository at this point in the history
  • Loading branch information
freya022 authored Jun 29, 2024
1 parent e24872e commit 4616946
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/java/net/dv8tion/jda/api/entities/Guild.java
Original file line number Diff line number Diff line change
Expand Up @@ -3722,7 +3722,7 @@ default AuditableRestAction<Void> kick(@Nonnull UserSnowflake user, @Nullable St
*/
@Nonnull
@CheckReturnValue
AuditableRestAction<BulkBanResponse> ban(@Nonnull Collection<UserSnowflake> users, @Nullable Duration deletionTime);
AuditableRestAction<BulkBanResponse> ban(@Nonnull Collection<? extends UserSnowflake> users, @Nullable Duration deletionTime);

/**
* Bans up to 200 of the provided users.
Expand Down Expand Up @@ -3763,7 +3763,7 @@ default AuditableRestAction<Void> kick(@Nonnull UserSnowflake user, @Nullable St
*/
@Nonnull
@CheckReturnValue
default AuditableRestAction<BulkBanResponse> ban(@Nonnull Collection<UserSnowflake> users, int deletionTimeframe, @Nonnull TimeUnit unit)
default AuditableRestAction<BulkBanResponse> ban(@Nonnull Collection<? extends UserSnowflake> users, int deletionTimeframe, @Nonnull TimeUnit unit)
{
Checks.notNull(unit, "TimeUnit");
return ban(users, Duration.ofSeconds(unit.toSeconds(deletionTimeframe)));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ public AuditableRestAction<Void> ban(@Nonnull UserSnowflake user, int duration,

@Nonnull
@Override
public AuditableRestAction<BulkBanResponse> ban(@Nonnull Collection<UserSnowflake> users, @Nullable Duration deletionTime)
public AuditableRestAction<BulkBanResponse> ban(@Nonnull Collection<? extends UserSnowflake> users, @Nullable Duration deletionTime)
{
deletionTime = deletionTime == null ? Duration.ZERO : deletionTime;
Checks.noneNull(users, "Users");
Expand Down

0 comments on commit 4616946

Please sign in to comment.