Layabout - Slack API Toolbelt
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