Skip to content

Commit

Permalink
Add LazyEmbed#setTimestamp(Long)
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed May 16, 2024
1 parent 8d0e1cf commit fcf866f
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/main/java/xyz/srnyx/lazylibrary/LazyEmbed.java
Original file line number Diff line number Diff line change
Expand Up @@ -623,6 +623,18 @@ public LazyEmbed setTimestamp(@Nullable TemporalAccessor timestamp) {
return this;
}

/**
* Sets the timestamp of the embed
*
* @param timestamp the timestamp of the embed
*
* @return this
*/
@NotNull
public LazyEmbed setTimestamp(@Nullable Long timestamp) {
return setTimestamp(timestamp == null ? null : Instant.ofEpochMilli(timestamp));
}

/**
* All possible (defaultable) keys an {@link LazyEmbed embed} can have ({@link LazySettings#embedDefaults})
*/
Expand Down Expand Up @@ -804,7 +816,7 @@ public static LazyEmbed invalidArguments(@NotNull Object... argumentsValues) {
if (argumentsValues.length % 2 != 0) throw new IllegalArgumentException("Each argument must have a value!");
final LazyEmbed embed = new LazyEmbed()
.setColor(Color.RED)
.setTitle("Invalid argument!");
.setTitle("Invalid arguments!");
for (int i = 0; i < argumentsValues.length; i += 2) embed.addField(String.valueOf(argumentsValues[i]), String.valueOf(argumentsValues[i + 1]), true);
return embed;
}
Expand Down

0 comments on commit fcf866f

Please sign in to comment.