Simple Crystal wrapper for Slack Incoming Webhooks
require "slack-incoming-webhooks"
slack = Slack::IncomingWebhooks.new "Your WEBHOOK_URL"
slack.post "text"
You can specify the channel and/or username and/or etc...
Please refer to here.
slack = Slack::IncomingWebhooks.new "Your WEBHOOK_URL", channel: "#hoge",
username: "Bot",
icon_emoji: ":ghost:"
Once a notifier has been initialized, you can update the channnel and/or username and/or etc...
slack.channel = "#huga"
slack.username = "MyBot"
You can create more richly-formatted messages using Attachments.
require "slack-incoming-webhooks"
slack = Slack::IncomingWebhooks.new "Your WEBHOOK_URL"
attachment = Slack::Attachment.new author_name: "hoge",
author_icon: "http://...cool_icon",
color: "#36a64f",
title: "TITLE",
title_link: "https://www.google.com"
slack.post "text with attachments", attachments: [attachment]
latest Crystal
- Fork it ( https://github.com/CastellaFactory/slack-incoming-webhooks/fork )
- Create your feature branch (git checkout -b my-new-feature)
- Commit your changes (git commit -am 'Add some feature')
- Push to the branch (git push origin my-new-feature)
- Create a new Pull Request
- CastellaFactory CastellaFactory - creator, maintainer