slackline/message

This module is generated by gleam run -m slackline_codegen/generate. Do not edit it by hand.

Messages, message metadata and reactions.

Message is one record covering every message shape the Web API returns: conversations.history and conversations.replies, chat.postMessage and friends, pins, stars, reactions and search results. Every field is optional because the shapes differ a lot (scheduled messages and chat.update responses have no ts, latest can be an empty object). See https://docs.slack.dev/reference/events/message.

Types

The assistant thread attached to an assistant_app_thread message.

pub type AssistantAppThreadInfo {
  AssistantAppThreadInfo(
    title: option.Option(String),
    title_blocks: option.Option(List(block.Block)),
    artifacts: option.Option(List(value.Value)),
  )
}

Constructors

The bot that sent a message.

pub type BotProfile {
  BotProfile(
    id: option.Option(String),
    app_id: option.Option(String),
    name: option.Option(String),
    deleted: option.Option(Bool),
    updated: option.Option(Int),
    team_id: option.Option(String),
    icons: option.Option(MessageIcons),
  )
}

Constructors

A bot mention inside a canvas.

pub type CanvasMention {
  CanvasMention(
    file_id: option.Option(String),
    section_id: option.Option(String),
    mentioning_user_ids: option.Option(List(String)),
  )
}

Constructors

A comment summary shown on a Work Object.

pub type EntityComments {
  EntityComments(
    count: option.Option(Int),
    latest_timestamp: option.Option(Int),
  )
}

Constructors

  • EntityComments(
      count: option.Option(Int),
      latest_timestamp: option.Option(Int),
    )

    Arguments

    count

    The number of comments on the entity.

    latest_timestamp

    The Unix timestamp of the latest comment.

Identifies a Work Object resource in the app’s own system.

pub type ExternalRef {
  ExternalRef(id: String, ref_type: option.Option(String))
}

Constructors

  • ExternalRef(id: String, ref_type: option.Option(String))

    Arguments

    id

    A string ID that uniquely identifies the resource. Use the same ID that your system uses to get the resource through its APIs.

    ref_type

    An optional internal type for the entity in the source system. It is only needed when the ID is not globally unique.

A huddle attached to a huddle_thread message.

pub type HuddleRoom {
  HuddleRoom(
    id: option.Option(String),
    name: option.Option(String),
    media_server: option.Option(String),
    created_by: option.Option(String),
    date_start: option.Option(Int),
    date_end: option.Option(Int),
    participants: option.Option(List(String)),
    participant_history: option.Option(List(String)),
    participants_camera_on: option.Option(List(String)),
    participants_camera_off: option.Option(List(String)),
    participants_screenshare_on: option.Option(List(String)),
    participants_screenshare_off: option.Option(List(String)),
    canvas_thread_ts: option.Option(String),
    thread_root_ts: option.Option(String),
    channels: option.Option(List(String)),
    is_dm_call: option.Option(Bool),
    was_rejected: option.Option(Bool),
    was_missed: option.Option(Bool),
    was_accepted: option.Option(Bool),
    has_ended: option.Option(Bool),
    background_id: option.Option(String),
    canvas_background: option.Option(String),
    is_prewarmed: option.Option(Bool),
    is_scheduled: option.Option(Bool),
    attached_file_ids: option.Option(List(String)),
    media_backend_type: option.Option(String),
    display_id: option.Option(String),
    external_unique_id: option.Option(String),
    app_id: option.Option(String),
    call_family: option.Option(String),
    pending_invitees: option.Option(value.Value),
    last_invite_status_by_user: option.Option(value.Value),
  )
}

Constructors

A message in a conversation.

pub type Message {
  Message(
    type_: option.Option(String),
    subtype: option.Option(MessageSubtype),
    ts: option.Option(String),
    thread_ts: option.Option(String),
    user: option.Option(String),
    bot_id: option.Option(String),
    app_id: option.Option(String),
    username: option.Option(String),
    text: option.Option(String),
    blocks: option.Option(List(block.Block)),
    attachments: option.Option(List(attachment.Attachment)),
    files: option.Option(List(file.File)),
    upload: option.Option(Bool),
    display_as_bot: option.Option(Bool),
    edited: option.Option(MessageEdited),
    reactions: option.Option(List(common.Reaction)),
    is_starred: option.Option(Bool),
    pinned_to: option.Option(List(String)),
    permalink: option.Option(String),
    team: option.Option(String),
    user_team: option.Option(String),
    source_team: option.Option(String),
    channel: option.Option(MessageChannelRef),
    channel_type: option.Option(String),
    event_ts: option.Option(String),
    hidden: option.Option(Bool),
    deleted_ts: option.Option(String),
    client_msg_id: option.Option(String),
    icons: option.Option(MessageIcons),
    bot_profile: option.Option(BotProfile),
    user_profile: option.Option(MessageUserProfile),
    metadata: option.Option(MessageMetadata),
    app_context: option.Option(value.Value),
    reply_count: option.Option(Int),
    reply_users_count: option.Option(Int),
    reply_users: option.Option(List(String)),
    latest_reply: option.Option(String),
    replies: option.Option(List(MessageReply)),
    subscribed: option.Option(Bool),
    last_read: option.Option(String),
    unread_count: option.Option(Int),
    parent_user_id: option.Option(String),
    is_locked: option.Option(Bool),
    root: option.Option(Message),
    inviter: option.Option(String),
    topic: option.Option(String),
    purpose: option.Option(String),
    name: option.Option(String),
    old_name: option.Option(String),
    members: option.Option(List(String)),
    item_type: option.Option(String),
    item: option.Option(value.Value),
    comment: option.Option(file.FileComment),
    file: option.Option(file.File),
    message: option.Option(Message),
    previous_message: option.Option(Message),
    document_mention: option.Option(CanvasMention),
    assistant_app_thread: option.Option(AssistantAppThreadInfo),
    room: option.Option(HuddleRoom),
    no_notifications: option.Option(Bool),
    iid: option.Option(String),
    score: option.Option(Float),
    previous: option.Option(Message),
    previous_2: option.Option(Message),
    next: option.Option(Message),
    next_2: option.Option(Message),
  )
}

Constructors

The channel summary included with search results.

pub type MessageChannel {
  MessageChannel(
    id: String,
    name: option.Option(String),
    is_channel: option.Option(Bool),
    is_group: option.Option(Bool),
    is_im: option.Option(Bool),
    is_mpim: option.Option(Bool),
    is_private: option.Option(Bool),
    is_shared: option.Option(Bool),
    is_ext_shared: option.Option(Bool),
    is_org_shared: option.Option(Bool),
    is_pending_ext_shared: option.Option(Bool),
    pending_shared: option.Option(List(String)),
    user: option.Option(String),
  )
}

Constructors

The channel of a message: an ID, or a summary object in search results.

pub type MessageChannelRef {
  MessageChannelId(String)
  MessageChannelInfo(MessageChannel)
}

Constructors

Who edited a message and when.

pub type MessageEdited {
  MessageEdited(
    user: option.Option(String),
    ts: option.Option(String),
  )
}

Constructors

  • MessageEdited(
      user: option.Option(String),
      ts: option.Option(String),
    )

    Arguments

    user

    The user ID of the editor.

    ts

    The timestamp of the edit.

Icons used for a bot message: an emoji or image URLs.

pub type MessageIcons {
  MessageIcons(
    emoji: option.Option(String),
    image_36: option.Option(String),
    image_48: option.Option(String),
    image_64: option.Option(String),
    image_72: option.Option(String),
  )
}

Constructors

Structured metadata attached to a message. Used both when sending (the metadata argument of chat.postMessage, chat.update, chat.unfurl and entity.presentDetails) and when receiving.

Event metadata sets event_type and event_payload. Work Object metadata sets entities (for chat.postMessage and chat.unfurl) or a single entity_type and entity_payload (for entity.presentDetails). See https://docs.slack.dev/messaging/message-metadata.

pub type MessageMetadata {
  MessageMetadata(
    event_type: option.Option(String),
    event_payload: option.Option(value.Value),
    entities: option.Option(List(WorkObjectEntity)),
    entity_type: option.Option(String),
    entity_payload: option.Option(value.Value),
  )
}

Constructors

  • MessageMetadata(
      event_type: option.Option(String),
      event_payload: option.Option(value.Value),
      entities: option.Option(List(WorkObjectEntity)),
      entity_type: option.Option(String),
      entity_payload: option.Option(value.Value),
    )

    Arguments

    event_type

    Identifies the type of event, such as ticket_created. Letters, numbers, underscores and hyphens only. Standard schemas include notification and approval.

    event_payload

    The event-specific fields.

    entities

    Work Object entities to unfurl or post.

    entity_type

    A single Work Object entity type (entity.presentDetails).

    entity_payload

    A single Work Object entity payload (entity.presentDetails).

A reply in the legacy replies list of a thread parent.

pub type MessageReply {
  MessageReply(
    user: option.Option(String),
    ts: option.Option(String),
  )
}

Constructors

pub type MessageSubtype {
  AssistantAppThread
  BotMessage
  ChannelArchive
  ChannelConvertToPrivate
  ChannelConvertToPublic
  ChannelJoin
  ChannelLeave
  ChannelName
  ChannelPostingPermissions
  ChannelPurpose
  ChannelTopic
  ChannelUnarchive
  DocumentMention
  EkmAccessDenied
  FileComment
  FileMention
  FileShare
  GroupArchive
  GroupJoin
  GroupLeave
  GroupName
  GroupPurpose
  GroupTopic
  GroupUnarchive
  HuddleThread
  MeMessage
  MessageChanged
  MessageDeleted
  MessageReplied
  PinnedItem
  ReminderAdd
  ReplyBroadcast
  ThreadBroadcast
  UnpinnedItem
  SlackbotResponse
  TabbedCanvasUpdated
  Tombstone
  UnknownMessageSubtype(String)
}

Constructors

  • AssistantAppThread

    assistant_app_thread

  • BotMessage

    bot_message

  • ChannelArchive

    channel_archive

  • ChannelConvertToPrivate

    channel_convert_to_private

  • ChannelConvertToPublic

    channel_convert_to_public

  • ChannelJoin

    channel_join

  • ChannelLeave

    channel_leave

  • ChannelName

    channel_name

  • ChannelPostingPermissions

    channel_posting_permissions

  • ChannelPurpose

    channel_purpose

  • ChannelTopic

    channel_topic

  • ChannelUnarchive

    channel_unarchive

  • DocumentMention

    document_mention

  • EkmAccessDenied

    ekm_access_denied

  • FileComment

    file_comment

  • FileMention

    file_mention

  • FileShare

    file_share

  • GroupArchive

    group_archive

  • GroupJoin

    group_join

  • GroupLeave

    group_leave

  • GroupName

    group_name

  • GroupPurpose

    group_purpose

  • GroupTopic

    group_topic

  • GroupUnarchive

    group_unarchive

  • HuddleThread

    huddle_thread

  • MeMessage

    me_message

  • MessageChanged

    message_changed

  • MessageDeleted

    message_deleted

  • MessageReplied

    message_replied

  • PinnedItem

    pinned_item

  • ReminderAdd

    reminder_add

  • ReplyBroadcast

    reply_broadcast

  • ThreadBroadcast

    thread_broadcast

  • UnpinnedItem

    unpinned_item

  • SlackbotResponse

    A reply from Slackbot, such as a custom response.

  • TabbedCanvasUpdated

    A canvas tab in the channel was updated.

  • Tombstone

    A deleted thread parent that remains as a placeholder for its replies.

  • UnknownMessageSubtype(String)

    A value that this version of slackline does not know.

The short sender profile included with some messages.

pub type MessageUserProfile {
  MessageUserProfile(
    avatar_hash: option.Option(String),
    image_72: option.Option(String),
    first_name: option.Option(String),
    real_name: option.Option(String),
    display_name: option.Option(String),
    team: option.Option(String),
    name: option.Option(String),
    is_restricted: option.Option(Bool),
    is_ultra_restricted: option.Option(Bool),
  )
}

Constructors

A Work Object entity in message metadata, as sent to chat.postMessage, chat.postEphemeral and chat.unfurl. See https://docs.slack.dev/messaging/work-objects-implementation.

pub type WorkObjectEntity {
  WorkObjectEntity(
    entity_type: String,
    external_ref: ExternalRef,
    url: String,
    entity_payload: value.Value,
    app_unfurl_url: option.Option(String),
    is_refreshable: option.Option(Bool),
    entity_comments: option.Option(EntityComments),
  )
}

Constructors

  • WorkObjectEntity(
      entity_type: String,
      external_ref: ExternalRef,
      url: String,
      entity_payload: value.Value,
      app_unfurl_url: option.Option(String),
      is_refreshable: option.Option(Bool),
      entity_comments: option.Option(EntityComments),
    )

    Arguments

    entity_type

    The entity type, such as slack#/entities/file or slack#/entities/task.

    external_ref

    Uniquely identifies the resource in the third-party system.

    url

    The URL that directs the user to the resource in the third-party system.

    entity_payload

    The properties displayed in the Work Object (attributes, fields, custom_fields, …).

    app_unfurl_url

    The URL posted by the user in a conversation, as found in the link_shared event. chat.unfurl uses it. Posting a message does not need it.

    is_refreshable

    Set to false to hide the refresh button and opt out of automatic refreshes.

    entity_comments

    A comment summary for the entity.

Values

pub fn assistant_app_thread_info_decoder() -> decode.Decoder(
  AssistantAppThreadInfo,
)

Decodes AssistantAppThreadInfo from json.

pub fn assistant_app_thread_info_to_json(
  it: AssistantAppThreadInfo,
) -> json.Json

Encodes AssistantAppThreadInfo as json.

pub fn bot_profile_decoder() -> decode.Decoder(BotProfile)

Decodes BotProfile from json.

pub fn bot_profile_to_json(it: BotProfile) -> json.Json

Encodes BotProfile as json.

pub fn canvas_mention_decoder() -> decode.Decoder(CanvasMention)

Decodes CanvasMention from json.

pub fn canvas_mention_to_json(it: CanvasMention) -> json.Json

Encodes CanvasMention as json.

pub fn entities_metadata(
  entities: List(WorkObjectEntity),
) -> MessageMetadata

Metadata with Work Object entities, for chat.postMessage, chat.postEphemeral and chat.unfurl.

pub fn entity_comments_decoder() -> decode.Decoder(EntityComments)

Decodes EntityComments from json.

pub fn entity_comments_to_json(it: EntityComments) -> json.Json

Encodes EntityComments as json.

pub fn entity_details_metadata(
  entity_type: String,
  entity_payload: value.Value,
) -> MessageMetadata

Metadata with one Work Object entity type and payload, for the flexpane of entity.presentDetails.

pub fn event_metadata(
  event_type: String,
  event_payload: value.Value,
) -> MessageMetadata

Metadata for an app event, for the metadata argument of chat.postMessage and chat.update.

message.event_metadata("ticket_created", value.Object([
  #("ticket_id", value.String("PROJ-1234")),
]))
pub fn external_ref_decoder() -> decode.Decoder(ExternalRef)

Decodes ExternalRef from json.

pub fn external_ref_to_json(it: ExternalRef) -> json.Json

Encodes ExternalRef as json.

pub fn huddle_room_decoder() -> decode.Decoder(HuddleRoom)

Decodes HuddleRoom from json.

pub fn huddle_room_to_json(it: HuddleRoom) -> json.Json

Encodes HuddleRoom as json.

pub fn message_channel_decoder() -> decode.Decoder(MessageChannel)

Decodes MessageChannel from json.

pub fn message_channel_ref_decoder() -> decode.Decoder(
  MessageChannelRef,
)

Decodes MessageChannelRef from json. It tries each alternative in order.

pub fn message_channel_ref_to_json(
  it: MessageChannelRef,
) -> json.Json

Encodes MessageChannelRef as json.

pub fn message_channel_to_json(it: MessageChannel) -> json.Json

Encodes MessageChannel as json.

pub fn message_decoder() -> decode.Decoder(Message)

Decodes Message from json.

pub fn message_edited_decoder() -> decode.Decoder(MessageEdited)

Decodes MessageEdited from json.

pub fn message_edited_to_json(it: MessageEdited) -> json.Json

Encodes MessageEdited as json.

pub fn message_icons_decoder() -> decode.Decoder(MessageIcons)

Decodes MessageIcons from json.

pub fn message_icons_to_json(it: MessageIcons) -> json.Json

Encodes MessageIcons as json.

pub fn message_metadata_decoder() -> decode.Decoder(
  MessageMetadata,
)

Decodes MessageMetadata from json.

pub fn message_metadata_to_json(it: MessageMetadata) -> json.Json

Encodes MessageMetadata as json.

pub fn message_reply_decoder() -> decode.Decoder(MessageReply)

Decodes MessageReply from json.

pub fn message_reply_to_json(it: MessageReply) -> json.Json

Encodes MessageReply as json.

pub fn message_subtype_decoder() -> decode.Decoder(MessageSubtype)

Decodes MessageSubtype from a json string.

pub fn message_subtype_from_string(
  string: String,
) -> MessageSubtype

Parses MessageSubtype from its json string.

pub fn message_subtype_to_json(it: MessageSubtype) -> json.Json

Encodes MessageSubtype as a json string.

pub fn message_subtype_to_string(it: MessageSubtype) -> String

The json string of MessageSubtype.

pub fn message_to_json(it: Message) -> json.Json

Encodes Message as json.

pub fn message_user_profile_decoder() -> decode.Decoder(
  MessageUserProfile,
)

Decodes MessageUserProfile from json.

pub fn message_user_profile_to_json(
  it: MessageUserProfile,
) -> json.Json

Encodes MessageUserProfile as json.

pub fn work_object_entity(
  entity_type entity_type: String,
  external_id external_id: String,
  url url: String,
  entity_payload entity_payload: value.Value,
) -> WorkObjectEntity

A Work Object entity from its required fields. external_id is the ID of the resource in your system. Set the optional fields with record update syntax.

pub fn work_object_entity_decoder() -> decode.Decoder(
  WorkObjectEntity,
)

Decodes WorkObjectEntity from json.

pub fn work_object_entity_to_json(
  it: WorkObjectEntity,
) -> json.Json

Encodes WorkObjectEntity as json.

✨ Search Document