class Slack::Surfaces::Message

App-published messages are dynamic yet transient spaces. They allow users to complete workflows among their Slack conversations.

api.slack.com/surfaces#messages api.slack.com/messaging/composing#complex_layouts

Constants

TYPE

Attributes

blocks[R]

Public Class Methods

new(blocks: nil, text: nil, channel: nil, thread_ts: nil, as_user: nil) click to toggle source
# File lib/slack/surfaces/message.rb, line 13
def initialize(blocks: nil, text: nil, channel: nil, thread_ts: nil, as_user: nil)
  @blocks = blocks || Slack::BlockKit::Blocks.new
  @channel = channel
  @thread_ts = thread_ts
  @as_user = as_user
  @text = text
end

Public Instance Methods

as_json(*) click to toggle source
# File lib/slack/surfaces/message.rb, line 23
def as_json(*)
  {
    channel: @channel,
    thread_ts: @thread_ts,
    as_user: @as_user,
    text: @text,
    blocks: @blocks.as_json
  }.compact
end