connectapi icon indicating copy to clipboard operation
connectapi copied to clipboard

feat: new function `set_content_image()`, deprecate old `set_image_*` functions

Open toph-allen opened this issue 5 months ago • 2 comments

Fixes #294 Fixes #304

  • Deprecate set_image_path(content, path), set_image_url(content, url), set_image_webshot(content).
  • Add a new function, set_content_image(content, path). The new function can handle a local file path or a remote URL. If the path points to a local file that exists, it will use that. Otherwise, if it is an https or http URL, it will attempt to download that image to a temporary file and use that (the old behavior of set_image_url().

In a future PR to the connect repo, set_image_webshot() will become a recipe in the SDK Cookbook.

Note: this wasn't based off the 0.3.0 release, so the NEWS will have a merge conflict once that PR has merged. Not sure why I started it from main, but I did 🤷🏻.

Replaces #302, which I accidentally closed with a force push.

toph-allen avatar Sep 06 '24 20:09 toph-allen