wag/cloud

Types

pub type Component {
  Body(text: String)
}

Constructors

  • Body(text: String)
pub type Contact {
  Contact(input: String, wa_id: String)
}

Constructors

  • Contact(input: String, wa_id: String)
pub type Interactive {
  ReplyButtons(
    header: option.Option(Source),
    body: String,
    footer: option.Option(String),
    buttons: List(ReplyButton),
  )
  CtaUrl(
    header: option.Option(Source),
    body: String,
    footer: option.Option(String),
    cta_text: String,
    cta_url: String,
  )
}

Constructors

pub type Media {
  Media(source: Source, caption: option.Option(String))
}

Constructors

pub type Message {
  Audio(media: Media)
  Contacts(
    contacts: List(contact_information.ContactInformation),
  )
  Document(
    source: Source,
    filename: String,
    caption: option.Option(String),
  )
  Image(media: Media)
  Interactive(Interactive)
  Location(
    latitude: Float,
    longitude: Float,
    name: option.Option(String),
    address: option.Option(String),
  )
  Sticker(source: Source)
  Template(
    name: String,
    language: String,
    components: List(Component),
  )
  Text(body: String, preview_url: Bool)
  Video(media: Media)
}

Constructors

pub type ReplyButton {
  ReplyButton(id: String, title: String)
}

Constructors

  • ReplyButton(id: String, title: String)
pub type Source {
  Ref(id: String)
  Link(link: String)
}

Constructors

  • Ref(id: String)
  • Link(link: String)

Values

pub fn button_to_json(button: ReplyButton) -> json.Json
pub fn retreive_media_request(
  token: String,
  media_id: String,
) -> request.Request(BitArray)
pub fn retreive_media_response(
  response: response.Response(BitArray),
) -> Result(String, BitArray)
pub fn send_message_request(
  token: String,
  from: String,
  to: String,
  message: Message,
) -> request.Request(BitArray)
pub fn send_message_response(
  response: response.Response(BitArray),
) -> Result(#(List(Contact), List(String)), BitArray)
pub fn send_typing_indicator(
  token: String,
  from: String,
  message_id: String,
  indicate_typing: Bool,
) -> request.Request(BitArray)
Search Document