Created
May 10, 2016 18:03
-
-
Save ryanpbrewster/d37e3022cd906024fe512b39a97a79e5 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import SlackErrorCode._ | |
| def tryToUpdateMessage(token: SlackAccessToken, channel: SlackChannelId, ts: SlackTimestamp, newText: String): Future[Unit] = { | |
| val updateRequest = SlackMessageUpdateRequest( | |
| text = newText, | |
| attachments = Seq.empty, | |
| unfurlLinks = false, | |
| unfurlMedia = false, | |
| parseMode = "none" | |
| ) | |
| slackClient.updateMessage(token, channel, ts, updateRequest) | |
| .map { _ => () } | |
| .recover { case SlackErrorCode(CANT_UPDATE_MESSAGE) => () } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment