Exemplo n.º 1
0
        private async Task SendMessageToChannel(string slackChannel, SlackMessageModel model)
        {
            var client = RestClient.For <ISlackApi>(options.SlackIntegrationUri);

            await client.SendMessageToSlack(
                new
            {
                username    = user,
                channel     = slackChannel,
                icon_emoji  = model.Icon,
                attachments = new object[]
                {
                    new
                    {
                        fallback   = $"{model.Title} <{model.Href}>",
                        color      = model.Color,
                        title      = model.Title,
                        title_link = model.Href,
                        text       = model.Text,
                        footer     = model.Href
                    }
                }
            });
        }
Exemplo n.º 2
0
 public void Send(string slackChannel, SlackMessageModel model)
 {
     throttler.Emit(slackChannel, model);
 }