Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not possible to set initial value of RichTextInputBlockElement due to wrong type #1276

Open
matcornic opened this issue Apr 11, 2024 · 0 comments

Comments

@matcornic
Copy link

Hello maintainers,

First, thanks a lot for this lib, it's very useful for us.
I encountered a bug: I can't set an initial value for the RichTextInputBlockElement due the type being a string and not a Rich text object

What happened

I tried to use this code, which is compiling on :

	elem := slack.NewRichTextInputBlockElement(nil, "test")
	elem.InitialValue = "test"
	elemInput := slack.NewInputBlock("", slack.NewTextBlockObject("plain_text", "Test:", false, false), nil, elemInput)

But got an invalid_block error on Slack while checking the generated json on the Block kit builder

https://app.slack.com/block-kit-builder/T02F6HSJU2H#%7B%22blocks%22:%5B%7B%22type%22:%22header%22,%22text%22:%7B%22type%22:%22plain_text%22,%22text%22:%22Test%22%7D%7D,%7B%22type%22:%22input%22,%22label%22:%7B%22type%22:%22plain_text%22,%22text%22:%22RulTestes:%22%7D,%22element%22:%7B%22type%22:%22rich_text_input%22,%22action_id%22:%22test%22,%22initial_value%22:%22test%22%7D%7D%5D%7D

image

Seeing the documentation, it expects a Rich text object https://api.slack.com/reference/block-kit/block-elements#rich_text_input

Versions

  • Go: 1.20
  • slack-go/slack: v0.12.5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant