Esempio n. 1
0
 public async Task SlackWebhookClient_AttachmentTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage()
                   .AddAttachment(x => x
                                  .SetAuthor("Success Test")
                                  .SetTitle("Test Title")
                                  .SetText("Test Text")
                                  .SetFooter("Test Footer")
                                  .SetColor(Color.Green))
                   .AddAttachment(x => x
                                  .SetAuthor("Warning Test")
                                  .SetTitle("Test Title")
                                  .SetText("Test Text")
                                  .SetFooter("Test Footer")
                                  .SetColor(Color.Yellow))
                   .AddAttachment(x => x
                                  .SetAuthor("Danger Test")
                                  .SetTitle("Test Title")
                                  .SetText("Test Text")
                                  .SetFooter("Test Footer")
                                  .SetColor(Color.Red));
     await client.PostMessageAsync(message);
 }
 public async Task SlackWebhookClient_DividerTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage("TEST")
                   .AddDividerBlock();
     await client.PostMessageAsync(message);
 }
 public async Task SlackWebhookClient_HeaderTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage("TEST")
                   .AddHeaderBlock(":smile: This is header test.");
     await client.PostMessageAsync(message);
 }
 public async Task SlackWebhookClient_SectionMarkdownBlockTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage("TEST")
                   .AddSectionBlock(x => x
                                    .SetMarkdown(":smile: *This* is markdown test."));
     await client.PostMessageAsync(message);
 }
 public async Task SlackWebhookClient_SectionImageAccessoryTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage("TEST")
                   .AddSectionBlock(x => x
                                    .SetMarkdown(":smile: *This* is markdown test.")
                                    .SetImageAccessory("https://s3-media3.fl.yelpcdn.com/bphoto/c7ed05m9lC2EmA3Aruue7A/o.jpg", "test image"));
     await client.PostMessageAsync(message);
 }
 public async Task SlackWebhookClient_SectionPlainTextBlockTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage("TEST")
                   .AddSectionBlock(x => x
                                    .SetPlainText("With emoji: :smile: this is plain text test."))
                   .AddSectionBlock(x => x
                                    .SetPlainText("Without emoji: :smile: this is plain text test.", false));
     await client.PostMessageAsync(message);
 }
 public async Task SlackWebhookClient_ContextTest()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage("TEST")
                   .AddContextBlock(x => x
                                    .AddImage("https://s3-media3.fl.yelpcdn.com/bphoto/c7ed05m9lC2EmA3Aruue7A/o.jpg", "test image")
                                    .AddPlainText(":smile: This is plain text test.")
                                    .AddMarkdown(":smile: *This* is markdown test."));
     await client.PostMessageAsync(message);
 }
Esempio n. 8
0
 public async Task SlackWebhookClient_Sandbox()
 {
     var client  = SlackClientHelper.CreateClient();
     var message = MessageBuilder
                   .CreateMessage()
                   .AddAttachment(x => x
                                  .SetAuthor("Binance")
                                  .SetText($":moneybag: Transfer from *Binance* to *Kraken* successfuly created.")
                                  .AddField("Amount", $"0.4 BTC")
                                  .SetFooter("Transfer Service"));
     await client.PostMessageAsync(message);
 }