Sha256: 60cb2a95e37b1a0b5845134e353e9fe33eabdc17091eade51d9c95af364385c7
Contents?: true
Size: 875 Bytes
Versions: 18
Compression:
Stored size: 875 Bytes
Contents
# frozen_string_literal: true module Slack module Surfaces # App-published messages are dynamic yet transient spaces. # They allow users to complete workflows among their Slack conversations. # # https://api.slack.com/surfaces#messages # https://api.slack.com/messaging/composing#complex_layouts class Message TYPE = 'message' 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 attr_reader :blocks def as_json(*) { channel: @channel, thread_ts: @thread_ts, as_user: @as_user, text: @text, blocks: @blocks.as_json }.compact end end end end
Version data entries
18 entries across 18 versions & 1 rubygems