DEV: supports blocks in chat message sdk (#29839)

Blocks have been added in 582de0ffe3 but were not yet supported in the SDK.
This commit is contained in:
Joffrey JAFFEUX
2024-11-20 08:06:48 +01:00
committed by GitHub
parent 6e1aeb1f50
commit eb41a07afb
2 changed files with 59 additions and 1 deletions

View File

@ -116,6 +116,7 @@ module ChatSDK
enforce_membership: false,
force_thread: false,
strip_whitespaces: true,
blocks: nil,
**params,
&block
)
@ -127,6 +128,7 @@ module ChatSDK
in_reply_to_id:,
thread_id:,
upload_ids:,
blocks:,
**params,
},
options: {
@ -145,6 +147,7 @@ module ChatSDK
on_failed_policy(:ensure_valid_thread_for_channel) do
raise "Couldn't find thread with id: `#{thread_id}`"
end
on_failed_policy(:accept_blocks) { raise "Only bots can create messages with blocks" }
on_failed_policy(:allowed_to_join_channel) do
raise "User with id: `#{guardian.user.id}` can't join this channel"
end