SlackChatProvider.

PostMessage(string, string, string) Method

Summary

Post message to Slack Channel
Assembly
Cake.Slack.dll
Namespace
Cake.Slack.Chat
Containing Type
SlackChatProvider

Syntax

public SlackChatMessageResult PostMessage(string token, string channel, string text)

Examples

     Information("Sending message to Slack...");

     var postMessageResult = Slack.Chat.PostMessage(
         "token",
         "Cake",
         "It's not a party without Cake!"
         );

     if(postMessageResult.Ok)
     {
         Information("Message {0} succesfully sent.", postMessageResult.TimeStamp);
     }
     else
     {
         Error("Failed to send message: {0}.", postMessageResult.Error);
     }

Attributes

Type Description
CakeAliasCategoryAttribute

Parameters

Name Type Description
token string SlackProvider auth token
channel string Channel to send message to. Can be a public channel, private group or IM channel. Can be an encoded ID, or a name.
text string Text of the message to send. For message formatting see Formatting | Slack

Return Value

Type Description
SlackChatMessageResult Returns success/error/timestamp SlackChatMessageResult