From 1e22904d00cf594c80fd88966176cbc12ee24efc Mon Sep 17 00:00:00 2001 From: awpTina Date: Tue, 24 Mar 2026 09:05:29 +0100 Subject: [PATCH 1/2] Fix: When posting texts containing links and with embed set to True, the following error came back: 'Invalid app.bsky.feed.post record: Expected "app.bsky.embed.external#external" (got "app.bsky.embed.external") at $.record.embed.external.'. Added #external to the end of the embed type to aovid this error --- R/record_post.R | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/R/record_post.R b/R/record_post.R index e4c60ca..7b63e8e 100644 --- a/R/record_post.R +++ b/R/record_post.R @@ -263,12 +263,12 @@ bs_post <- function(text, images, images_alt, # 1. list of embeds manually provided if (is.list(embed)) { card <- list( - '$type' = 'app.bsky.embed.external', + '$type' = 'app.bsky.embed.external#external', external = embed ) } else if (is.character(embed) && is_online_link(embed)) { card <- list( - '$type' = 'app.bsky.embed.external', + '$type' = 'app.bsky.embed.external#external', external = bs_new_embed_external(uri = embed, auth = auth) ) } else if (isTRUE(embed)) { @@ -276,7 +276,7 @@ bs_post <- function(text, images, images_alt, tenor_gif <- parse_tenor_gif(text, user = user, pass = pass, auth = auth) if (!is.null(tenor_gif)) { card <- list( - '$type' = 'app.bsky.embed.external', + '$type' = 'app.bsky.embed.external#external', external = tenor_gif ) } else { @@ -284,7 +284,7 @@ bs_post <- function(text, images, images_alt, link_card <- parse_first_link(text, auth = auth) if (!is.null(link_card)) { card <- list( - '$type' = 'app.bsky.embed.external', + '$type' = 'app.bsky.embed.external#external', external = link_card ) } From 8937d02b8d33a8214811a5e5a74dfa5c395c5f19 Mon Sep 17 00:00:00 2001 From: awpTina Date: Tue, 24 Mar 2026 13:57:31 +0100 Subject: [PATCH 2/2] Original fix was applied to the wrong type. Now applied on inner instead of outer object to restore link card display --- R/embed_external.R | 2 +- R/record_post.R | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/R/embed_external.R b/R/embed_external.R index c374e03..538836f 100644 --- a/R/embed_external.R +++ b/R/embed_external.R @@ -94,7 +94,7 @@ bs_new_embed_external <- function(uri, title, description, thumb, rec <- list( - `$type` = 'app.bsky.embed.external', + `$type` = 'app.bsky.embed.external#external', # external = list( uri = uri, title = title, diff --git a/R/record_post.R b/R/record_post.R index 7b63e8e..e4c60ca 100644 --- a/R/record_post.R +++ b/R/record_post.R @@ -263,12 +263,12 @@ bs_post <- function(text, images, images_alt, # 1. list of embeds manually provided if (is.list(embed)) { card <- list( - '$type' = 'app.bsky.embed.external#external', + '$type' = 'app.bsky.embed.external', external = embed ) } else if (is.character(embed) && is_online_link(embed)) { card <- list( - '$type' = 'app.bsky.embed.external#external', + '$type' = 'app.bsky.embed.external', external = bs_new_embed_external(uri = embed, auth = auth) ) } else if (isTRUE(embed)) { @@ -276,7 +276,7 @@ bs_post <- function(text, images, images_alt, tenor_gif <- parse_tenor_gif(text, user = user, pass = pass, auth = auth) if (!is.null(tenor_gif)) { card <- list( - '$type' = 'app.bsky.embed.external#external', + '$type' = 'app.bsky.embed.external', external = tenor_gif ) } else { @@ -284,7 +284,7 @@ bs_post <- function(text, images, images_alt, link_card <- parse_first_link(text, auth = auth) if (!is.null(link_card)) { card <- list( - '$type' = 'app.bsky.embed.external#external', + '$type' = 'app.bsky.embed.external', external = link_card ) }