Lingo.Embed (Lingo v0.4.2)

Copy Markdown View Source

Builds message embeds.

Lingo.Api.Message.create(channel_id, %{
  embeds: [Lingo.Embed.build(title: "Results", color: 0x57F287, fields: [%{name: "Score", value: "42"}])]
})

Embeds Discord sends back are Lingo.Type.Embed structs.

Summary

Functions

Builds an embed from options: :title, :description, :url, :color (an integer like 0x5865F2), :timestamp (a DateTime), :image and :thumbnail (URLs), :footer (text), :author (a name) and :fields (maps with :name, :value and :inline).

Functions

build(opts)

@spec build(keyword()) :: map()

Builds an embed from options: :title, :description, :url, :color (an integer like 0x5865F2), :timestamp (a DateTime), :image and :thumbnail (URLs), :footer (text), :author (a name) and :fields (maps with :name, :value and :inline).

:image, :thumbnail, :footer and :author also take the full maps Discord expects.