Skip to content

Commit

Permalink
DiscordEmbedTag.to_json
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Aug 31, 2022
1 parent 400938f commit f5009e1
Showing 1 changed file with 11 additions and 0 deletions.
Expand Up @@ -388,6 +388,17 @@ else if (key.equals("color")) {
tagProcessor.registerTag(ElementTag.class, "output_length", (attribute, object) -> {
return new ElementTag(object.duplicate().build(attribute.context).length());
});

// <--[tag]
// @attribute <DiscordEmbedTag.to_json>
// @returns ElementTag
// @plugin dDiscordBot
// @description
// Returns the raw Discord-compatible JSON text of this embed.
// -->
tagProcessor.registerTag(ElementTag.class, "to_json", (attribute, object) -> {
return new ElementTag(object.duplicate().build(attribute.context).build().toData().toString());
});
}

public static ObjectTagProcessor<DiscordEmbedTag> tagProcessor = new ObjectTagProcessor<>();
Expand Down

0 comments on commit f5009e1

Please sign in to comment.