Skip to content

Commit

Permalink
Merge pull request #152 from derpyplops/permalink
Browse files Browse the repository at this point in the history
Implement chats.getPermalink
  • Loading branch information
paulpdaniels authored May 19, 2021
2 parents 1939f65 + dcafed1 commit 3a1de91
Showing 1 changed file with 15 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ import io.circe.syntax._
import zio.ZIO

trait SlackChats {
def permalink(channelId: String, ts: String): ZIO[SlackEnv, SlackError, String] =
sendM(request("chat.getPermalink", "channel" -> channelId, "message_ts" -> ts)) >>= as[String]("permalink")

def deleteChat(channelId: String, ts: String, asUser: Option[Boolean] = None): ZIO[SlackEnv, SlackError, Boolean] =
sendM(request("chat.delete", "channel" -> channelId, "ts" -> ts, "as_user" -> asUser)) >>= isOk

Expand All @@ -19,7 +22,7 @@ trait SlackChats {
attachments: Option[Seq[Attachment]] = None,
blocks: Option[Seq[Block]] = None,
linkNames: Option[Boolean] = None
): ZIO[SlackEnv, SlackError, String] =
): ZIO[SlackEnv, SlackError, String] =
sendM(
requestJson(
"chat.postEphemeral",
Expand Down Expand Up @@ -84,15 +87,17 @@ trait SlackChats {
)
) >>= as[String]("ts")

def updateChatMessage(channelId: String,
ts: String,
text: String,
attachments: Option[Seq[Attachment]] = None,
blocks: Option[Seq[Block]] = None,
parse: Option[String] = None,
linkNames: Option[String] = None,
asUser: Option[Boolean] = None,
threadTs: Option[String] = None): ZIO[SlackEnv, SlackError, UpdateResponse] =
def updateChatMessage(
channelId: String,
ts: String,
text: String,
attachments: Option[Seq[Attachment]] = None,
blocks: Option[Seq[Block]] = None,
parse: Option[String] = None,
linkNames: Option[String] = None,
asUser: Option[Boolean] = None,
threadTs: Option[String] = None
): ZIO[SlackEnv, SlackError, UpdateResponse] =
sendM(
requestJson(
"chat.update",
Expand Down

0 comments on commit 3a1de91

Please sign in to comment.