slackapi / bolt-python

A framework to build Slack apps using Python
https://slack.dev/bolt-python/
MIT License
1.02k stars 236 forks source link

Add canvases APIs to the WebClient #1106

Closed ijtrigoso closed 6 days ago

ijtrigoso commented 6 days ago

Goal: Slack has added a new API (Create Canvases) and is yet to be added to the Slack Bolt Kit. Running the .client.conversations_canvases_create return the following error: """ AttributeError: 'WebClient' object has no attribute 'conversations_canvases_create' """

Link to Slack documentation: https://api.slack.com/methods/conversations.canvases.create

Please read the Contributing guidelines and Code of Conduct before creating this issue or pull request. By submitting, you are agreeing to those rules.

zimeg commented 6 days ago

Hey @ijtrigoso! 👋 Thanks for raising this issue! A change to the underlying SDK introduced the conversations.canvases.create method in slackapi/python-slack-sdk#1508 and we'll get started on a release to Bolt Python super soon 🚀

On the current v1.19.0 these methods can still be called using a string argument for the method name. It's a bit more prone to misspelling, but should be calling this API as intended! Hope this helps for now 🙏

zimeg commented 6 days ago

Oops! I thought the SDK version was fixed in Bolt but it seems to offer a range of supported SDK versions!

I tested the following snippet with a new Bolt app and the latest version of the SDK v3.30.0 and found that it works with the right scopes and channel ID:

client.conversations_canvases_create(
    channel_id="C0123456789",
    document_content={
        "type": "markdown",
        "markdown": "hello!"
    }
)

If it's possible to bump the SDK version you're using, this method should be unlocked! 🚀

Didn't mean to cause confusion with that first response, but I'll go ahead and close this issue as Done since this method is available with the right changes. Please do feel free to follow up with any other questions though!

ijtrigoso commented 6 days ago

You are right, thank you! I updated my Slack Bolt and forgot about Slack-SDK.