GitterChatProvider.

PostMessage(string, GitterChatMessageSettings) Method

Summary

Post message to Gitter Room
Assembly
Cake.Gitter.dll
Namespace
Cake.Gitter.Chat
Containing Type
GitterChatProvider

Syntax

public GitterChatMessageResult PostMessage(string message, GitterChatMessageSettings messageSettings)

Examples

Post directly into a specified Gitter Room, using the RoomId and authorization Token.

Cake task:

Gitter.Chat.PostMessage(message:"Hello from Cake.Gitter API, messageSettings:new GitterChatMessageSettings {
    Token              = "123456",
    RoomId             = "123456"
});

Post to the Activity Feed within a Gitter Room using a custom Web Hook Url.

Cake task:

Gitter.Chat.PostMessage(message:"Hello from Cake.Gitter Web Hook, messageSettings:new GitterChatMessageSettings {
    IncomingWebHookUrl = "http://yourwebhookurl.net"
});

Post to the Activity Feed within a Gitter Room using a custom Web Hook Url, specifying that there has been an error.

Cake task:

Gitter.Chat.PostMessage(message:"Hello from Cake.Gitter Web Hook, messageSettings:new GitterChatMessageSettings {
    IncomingWebHookUrl = "http://yourwebhookurl.net",
    MessageLevel = GitterMessageLevel.Error
});

Attributes

Type Description
CakeAliasCategoryAttribute

Parameters

Name Type Description
message string The message to send.
messageSettings GitterChatMessageSettings Lets you override default settings like UserName, IconUrl or if it should ThrowOnFail

Return Value

Type Description
GitterChatMessageResult Returns success/error/timestamp GitterChatMessageResult