Skip to content

Commit

Permalink
Add EmbedField inline convenience methods
Browse files Browse the repository at this point in the history
  • Loading branch information
schnapster committed Nov 19, 2023
1 parent 279317a commit 35e2c57
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion src/main/kotlin/dev/capybaralabs/shipa/discord/model/Embed.kt
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,21 @@ data class EmbedField private constructor(
return EmbedField(
(name ?: ZERO_WIDTH_SPACE).let { it.ifBlank { ZERO_WIDTH_SPACE } },
(value ?: ZERO_WIDTH_SPACE).let { it.ifBlank { ZERO_WIDTH_SPACE } },
inline
inline,
)
}

fun blank(inline: Boolean? = null): EmbedField {
return EmbedField(ZERO_WIDTH_SPACE, ZERO_WIDTH_SPACE, inline)
}

fun inlined(name: String? = null, value: String? = null): EmbedField {
return EmbedField(name, value, true)
}

fun fullWidth(name: String? = null, value: String? = null): EmbedField {
return EmbedField(name, value, false)
}

}
}

0 comments on commit 35e2c57

Please sign in to comment.