Embed
This data type describes the Embed message builder. Almost all the methods return the same builder, so it is possible to build a method chains like this:
{% do channel
.createEmbed()
.withContent('Content outside the embed')
.withTitle('Title', 'https://juniper.bot')
.withDescription('Oh, hi!')
.appendDescription('\nHow are you?')
.withDate(1587713425964)
.withColor('ffff00')
.withThumbnail(member.avatarUrl)
.withImage('https://i.pinimg.com/originals/a4/41/6e/a4416e024d691af3a2971e4114a6da7f.png')
.withAuthor(member.nickname)
.withFooter('Huff, bye!', member.avatarUrl)
.addField('First field', 'Ah! A value of the first field', true)
.addField('Second field', 'Something here too', true)
.addReaction(':fox_face:')
.addButton('LINK', 'https://juniper.bot/', 'Website', '🦊')
.send()
%}
Properties
| Property | Type | Description |
|---|---|---|
empty | Boolean | true if empty |
validLength | Boolean | true if length is valid to send this message |
length | Number | Current embed length |
Methods
withContent(Content)
withTitle(Name, URL)
withAuthor(Name, URL, IconURL)
withDescription(Content)
appendDescription(String)
withThumbnail(URL)
withImage(URL)
withColor(Color)
Sets Embed border color, this method accepts HEX color string, for example #FF0000 for red (you can remove the #).
Returns: Embed
withDate(Date)
withFooter(Content, IconURL)
addField(Name, Value, IsInline)
addBlankField(IsInline)
addReaction(Emote)
addButton(Style, URL_ID, Label, Emote, UUID, Disabled)
addSelectMenu(Type, ID, Label, UUID, Disabled)
Adds a select menu to the resulting message of this embed. Works the same as select_menu function.
Returns: MenuBuilder
addComponentsRow()
withPoll(Question, Duration, IsMultiAnswer)
addPollAnswer(Answer, Emote)
clearFields()
clear()
error()
deleteAfterSec(Seconds)
preferEphemeral(Ephemeral)
Sets if ephemeral (personal) message should be preferred.
Will only take effect if action is executed by the interaction (slash command, components, menu, modal, etc), is not deferred and only for override!
Returns: Embed
editComponentMessage(Edit)
Sets if original message content should be replaced by this one.
Will only take effect if action is executed by component or modal and only for override!
Returns: Embed
withAllowedMentions(Types)
pin(Pin)
unpin(Unpin)
send()
Sends message to the channel where this builder were created.
Returns true if message was sent successfully
Returns: Boolean
Warning! Quota
Following methods have shared quota and can only be invoked 2 times in the same template:
sendsendAndGetupdateupdateAndGetChannel#sendMessageChannel#sendMessageAndGet
sendAndGet()
Sends message to the channel where this builder were created.
Returns result message object if it was sent successfully
Returns: Message
Warning! Quota
Following methods have shared quota and can only be invoked 2 times in the same template:
sendsendAndGetupdateupdateAndGetChannel#sendMessageChannel#sendMessageAndGet
update(id)
Updates message by the Message ID given.
Returns true, if message was successfully updated.
You can only edit bot's messages!
Returns: Boolean
Warning! Quota
Following methods have shared quota and can only be invoked 2 times in the same template:
sendsendAndGetupdateupdateAndGetChannel#sendMessageChannel#sendMessageAndGet
updateAndGet(id)
Updates message by the Message ID given.
Returns result message object, if it was successfully updated.
You can only edit bot's messages!
Returns: Message
Warning! Quota
Following methods have shared quota and can only be invoked 2 times in the same template:
sendsendAndGetupdateupdateAndGetChannel#sendMessageChannel#sendMessageAndGet