Project

slackly

0.0
No commit activity in last 3 years
No release in over 3 years
Slackly is a simple and easy way to send messages to your Slack channels using the incoming webhooks integration.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

>= 1.8.2, ~> 1.8
>= 0.10.1, ~> 0.10.1
>= 3.2.0, ~> 3.2.0
>= 0.30.1, ~> 0.30.1
>= 1.21.0, ~> 1.21.0

Runtime

>= 1.8.2, ~> 1.8
 Project Readme

Slackly

Build Status Dependency Status Gem Version Code Climate Coverage Status

Description

Slackly is a simple and easy way to send messages to your Slack channels using the incoming webhooks integration. You can use it directly in your code or through the command line.

Installation

gem install slackly

Usage

In your code:

s = Slackly.new(webhook_url)
s.message(text: 'Hello from Slackly')

Command line:

slackly message 'Hello from Slackly!'

Configuration

In your code:

# these options will be the default client options and may be overriden by the message options
client_options = {
  username: 'slackly',
  icon_emoji: ':ghost:'
}
s = Slackly.new(webhook_url, client_options)

# these options will be sent for this message and will override any client options
message_options = {
  text: 'Hello from Slackly',
  channel: '#slackly'
}
s.message(message_options)

The command line needs a JSON configuration file in order to configure the webhook, it defaults to './slackly.json' but you can override it with the -c option. The JSON configuration file must must have a webhook_url option in order for the command line to work:

slackly message 'Hello from Slackly!' -c path_to/config.json

Both the code version and JSON configuration file accept any configuration option provided by Slack as described in here.

Contributing

  1. Fork it (https://github.com/pedrocarrico/slackly/fork)
  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

License

Slackly is released under the MIT License.