All Downloads are FREE. Search and download functionalities are using the official Maven repository.

slack.realtime.models.OutboundMessage.scala Maven / Gradle / Ivy

The newest version!
package slack.realtime.models

import io.circe.syntax._
import io.circe.{ Encoder, Json }

sealed trait OutboundMessage

object OutboundMessage {

  implicit val sendMessageEncoder: Encoder.AsObject[SendMessage] = io.circe.generic.semiauto.deriveEncoder[SendMessage]

  implicit val encoder: Encoder[OutboundMessage] = Encoder.instance {
    case i: SendMessage => i.asJson.deepMerge(Json.obj("type" -> "message".asJson))
  }

}

case class SendMessage(channel: String, text: String, thread_ts: Option[String] = None) extends OutboundMessage




© 2015 - 2025 Weber Informatics LLC | Privacy Policy