summaryrefslogtreecommitdiff
path: root/deps/discord-haskell/docs/embeds.md
diff options
context:
space:
mode:
authorLLLL Colonq <llll@colonq>2023-11-16 19:06:43 -0500
committerLLLL Colonq <llll@colonq>2023-11-16 19:06:43 -0500
commitdcef0b65069fb38fd0f6c4382353167f603ebff1 (patch)
tree45954ffe308c3dd056e6af4f734e6d2af89e5856 /deps/discord-haskell/docs/embeds.md
Initial commit
Diffstat (limited to 'deps/discord-haskell/docs/embeds.md')
-rw-r--r--deps/discord-haskell/docs/embeds.md21
1 files changed, 21 insertions, 0 deletions
diff --git a/deps/discord-haskell/docs/embeds.md b/deps/discord-haskell/docs/embeds.md
new file mode 100644
index 0000000..eec38d9
--- /dev/null
+++ b/deps/discord-haskell/docs/embeds.md
@@ -0,0 +1,21 @@
+
+### Embeds
+
+Embeds are special messages with boarders and images. [Example embed created by discord-haskell](./examples/embed-photo.jpg)
+
+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:
+
+```haskell
+_ <- 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.