LemonChannels.OutboundPayload (lemon_channels v0.1.0)

View Source

Outbound payload for channel delivery.

Represents a message to be delivered to a channel.

Summary

Functions

Create a new outbound payload.

Types

content()

@type content() :: binary() | map()

kind()

@type kind() :: :text | :edit | :delete | :reaction | :file | :voice

peer()

@type peer() :: %{
  kind: :dm | :group | :channel,
  id: binary(),
  thread_id: binary() | nil
}

t()

@type t() :: %LemonChannels.OutboundPayload{
  account_id: binary(),
  channel_id: binary(),
  content: content(),
  idempotency_key: binary() | nil,
  kind: kind(),
  meta: map() | nil,
  notify_pid: pid() | nil,
  notify_ref: reference() | nil,
  peer: peer(),
  reply_to: binary() | nil
}

Functions

edit(channel_id, account_id, peer, message_id, text, opts \\ [])

@spec edit(
  channel_id :: binary(),
  account_id :: binary(),
  peer :: peer(),
  message_id :: binary(),
  text :: binary(),
  opts :: keyword()
) :: t()

Create an edit message payload.

new(opts)

@spec new(keyword()) :: t()

Create a new outbound payload.

text(channel_id, account_id, peer, text, opts \\ [])

@spec text(
  channel_id :: binary(),
  account_id :: binary(),
  peer :: peer(),
  text :: binary(),
  opts :: keyword()
) :: t()

Create a text message payload.