-customembed
command don't work in custom commands. If you want to know how you can use embeds in custom commands, scroll down to Embeds in Custom Commands.customembed
commandcustomembed
(or for short, ce
). -ce
. After this, I start my object (the embed) with a curly brace. Then we have the name of the object (title) and the value of it (This is my title). We separate data with commas. After that we have the same thing again, but for the description. In the end we close the object (embed) with another curly brace.{
) and end with a curly brace (}
). Between this, you can add names and their according values. Data (a name and a value) get separated by commas (,
) . Around strings (text) you wrap two quotation marks (""
), but nothing around integers (whole numbers) or booleans (true or false statements). You can play around with this a bit.}
). After this you can just copy and paste it into Discord:embed
in the well-known templating curly braces. This makes it a bit clearer as your embed can get difficult to read. After this I start my embed object with cembed
(custom embed) to indicate what the following strings mean. We don't follow the json syntax here and only define everything one after the other ("name
" "value
" et cetera). Now we use the objects for discord embeds from the developer page again. So far, so good. In the end we send our embed with the sendMessage template. nil
sends it in the same channel, but you could also replace it with a channel name or ID (or send the embed with sendDM as a direct message). joinStr
to join two strings (text snippets) together. This is the case because I want to use the .User.Username
template. cembed takes Strings, so it would convert {{ .User.Username }}
into {{ .User.Username }} instead of the username of the user. The syntax of joinStr
is joinStr "seperator" "string1" "string2"...
, so we're first setting the separator to nothing and then joining our strings "Hello there, ", the username and an exclamation mark.
Next, we have the description. We can use markdown of Discord in here. After that object, I define the color. The color is given as integer and you can convert a hex color to it here..Guild.JoinedAt
as timestamp to display when the first person joined this server and close the template. After this we just have to send the embed using SendMessage
or SendDM
. Here is our result:imageembed
simpleembed
commandsimpleembed
command, se
for short.{{execAdmin "se" "-desc" "This is my description"}}