mirror of
https://github.com/discourse/discourse.git
synced 2025-05-23 08:51:05 +08:00
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:
@ -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
|
||||
|
Reference in New Issue
Block a user