Embed Create
Creating and Sending an Embed Example
Importing Functions:
We first import
newCommand
andembedCreate
from themvk-project
package. Later, we will also importsendMessage
to send the created embed.Importing
sendMessage
:Now, we include
sendMessage
to handle sending the embed.Defining a New Command:
We define a new command named
test-command
. This command will be executed when called in a message.Creating an Embed:
Inside the command's
code
function, we create an embed usingembedCreate
. The embed has a description, color, and footer.Sending the Embed:
Finally, we send the created embed using
sendMessage
, specifying the channel and the embed.Final Code:
Embed Options:
The embedCreate
function supports the following options:
title
titleUrl
author
authorIcon
thumbnail
image
description
color
footer
footerIcon
timestamp
All options are strings, except for timestamp
, which is a boolean.
Last updated