Module: Slk::Models

Defined in:
lib/slk.rb,
lib/slk/models/user.rb,
lib/slk/models/preset.rb,
lib/slk/models/status.rb,
lib/slk/models/channel.rb,
lib/slk/models/message.rb,
lib/slk/models/duration.rb,
lib/slk/models/reaction.rb,
lib/slk/models/workspace.rb,
lib/slk/models/saved_item.rb,
lib/slk/models/search_result.rb

Overview

Data models for Slack entities

Defined Under Namespace

Classes: Channel, Duration, Message, Preset, Reaction, SavedItem, SearchResult, Status, User, Workspace

Constant Summary collapse

USER_ID_PATTERN =

Slack user IDs start with U or W (enterprise grid)

/\A[UW][A-Z0-9]+\z/
MESSAGE_BLOCK_TEXT_THRESHOLD =

Minimum text length before we extract content from Block Kit blocks. Slack sometimes sends minimal text (like a link preview) with the full content in blocks. 20 chars catches most of these cases without unnecessarily processing blocks for normal messages.

20
DURATION_UNITS =

Duration unit multipliers (seconds per unit)

{ 'h' => 3600, 'm' => 60, 's' => 1 }.freeze
VALID_TOKEN_PREFIXES =

Valid token prefixes for Slack tokens

%w[xoxb- xoxc- xoxp-].freeze
SAVED_STATE_SAVED =

State constants for saved items

'saved'
SAVED_STATE_IN_PROGRESS =
'in_progress'
SAVED_STATE_COMPLETED =
'completed'