Project

layabout

0.0
Repository is archived
No commit activity in last 3 years
No release in over 3 years
slack.com API toolbelt
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

~> 2.1.1
 Project Readme

Layabout - Slack API Toolbelt

Build Status Code Climate Test Coverage Gem Version

Configuration

Layabout.configure do |config|
  config.team  = 'isotope11'
  config.token = 'your-api-token'
 end

Usage

Layabout.say('hello world', '#random',
  username: 'Annoying bot')                         # Posts a message via Chat API as 'Annoying Bot'
Layabout.say_with_webhook('howdy', 'special-token') # Posts a message using a incoming webhook
Layabout.join('#random')                            # Join a channel. You may also use a channel ID here
Layabout.leave('C234546')                           # Leave a channel by ID. Channel name does not work here
Layabout.upload('/path/to/a/silly.gif', 'C234546')  # Upload a file. You must specify the channel ID ...
Layabout.channels                                   # Return a list of channels for your team
Layabout.users                                      # Return a list of users for your team

Command-line usage

  Usage:
    layabout COMMAND [options...]

  Examples:
    export SLACK_TEAM=your-slack-team
    export SLACK_API_TOKEN=your-api-token

    echo 'hello world' | layabout say --channel ruby --username "Karl Childers"
    layabout say --channel ruby --username "Karl Childers" --message "hello world"
    layabout upload --file /path/to/kitten.gif --channel C234546