Skip to content

Latest commit

 

History

History
21 lines (14 loc) · 846 Bytes

embeds.md

File metadata and controls

21 lines (14 loc) · 846 Bytes

Embeds

Embeds are special messages with boarders and images. Example embed created by discord-haskell

The Embed record (and sub-records) store embed data received from Discord.

The CreateEmbed record stores data when we want to create an embed.

CreateEmbed has a Default instance, so you only need to specify the fields you use:

_ <- restCall (R.CreateMessageEmbed <channel_id> "Pong!" $
        def { createEmbedTitle = "Pong Embed"
            , createEmbedImage = Just $ CreateEmbedImageUpload <bytestring>
            , createEmbedThumbnail = Just $ CreateEmbedImageUrl
                    "https://avatars2.githubusercontent.com/u/37496339"
            })

Uploading a file each time is slow, prefer uploading images to a hosting site like imgur.com, and then referencing them.