Skip to content

Commit

Permalink
Add LazyEmbed#empty()
Browse files Browse the repository at this point in the history
  • Loading branch information
srnyx committed Oct 11, 2024
1 parent a3f048d commit fd575c8
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/main/java/xyz/srnyx/lazylibrary/LazyEmbed.java
Original file line number Diff line number Diff line change
Expand Up @@ -662,6 +662,8 @@ public LazyEmbed addEmptyFields(int amount, boolean inline) {
* @param rows the rows of fields to add
*
* @return this
*
* @see #gridFields(Map...)
*/
@NotNull
public LazyEmbed gridFields(@NotNull Collection<Map<String, String>> rows) {
Expand All @@ -687,6 +689,8 @@ public LazyEmbed gridFields(@NotNull Collection<Map<String, String>> rows) {
* @param rows the rows of fields to add
*
* @return this
*
* @see #gridFields(Collection)
*/
@NotNull @SafeVarargs
public final LazyEmbed gridFields(@NotNull Map<String, String>... rows) {
Expand Down Expand Up @@ -1072,4 +1076,18 @@ public static LazyEmbed invalidArguments(@NotNull Object... argumentsValues) {
for (int i = 0; i < argumentsValues.length; i += 2) embed.addField(String.valueOf(argumentsValues[i]), String.valueOf(argumentsValues[i + 1]), true);
return embed;
}

/**
* A pre-built {@link LazyEmbed} that has no color ({@code #2b2d31}, which blends in with the embed background) and has all default key values disabled
* <br>It's basically just a completely empty embed/rectangle for you to fill in
* <br>Works great with {@link LazyEmbed#gridFields(Collection)}
*
* @return the {@link LazyEmbed}
*/
@NotNull
public static LazyEmbed empty() {
return new LazyEmbed()
.setColor(0x2b2d31)
.disableDefaults(Key.values());
}
}

0 comments on commit fd575c8

Please sign in to comment.