Project

slackhook

0.0
No commit activity in last 3 years
No release in over 3 years
Easily add Slack Webhook integration to your Ruby application.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
 Dependencies

Development

~> 1.7
~> 5.5.0
~> 10.0
 Project Readme

Slackhook

Easily add Slack WebHooks integration and send messages from your Ruby application.

Installation

Add this line to your application's Gemfile:

gem 'slackhook'

And then execute:

$ bundle

Or install it yourself as:

$ gem install slackhook

Usage

To use this gem you only need to configure the Incoming WebHook integration in Slack.

You can find this using your slack account and going to Incoming WebHooks and select your default channel.

Well, now you are ready to send messages to Slack channels \0/!

Quick start

# This is how you send messages to your default channel.
Slackhook.send_hook({webhook_url: "your_webhook_url", text: "test message"})

There are also username and icon_type (slackbot is the default) options to be more specific about the nickname and avatar which would appear on the chat.

You can use the channel option if the message is goint to be sent to a non default channel.

> require "slackhook"
> Slackhook.send_hook({ webhook_url: "your_webhook_url",
                        text: "test message",
                        channel: "@your-channel",
                        username: "testbot",
                        icon_type: ":trollface:"})

You can also use icon_url instead of icon_type if you want to use some additional icon image.

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request

Contributors