• Stars
    star
    20
  • Rank 1,085,583 (Top 23 %)
  • Language
    Crystal
  • License
    MIT License
  • Created over 9 years ago
  • Updated 10 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Parse Slack slash commands or send incoming web hooks from Crystal

crystal_slack

Build Status

Access Slack API's using Crystal.

Shards

slack:
  github: "manastech/crystal_slack"

Usage

You can get a Slack::SlashCommand from an HTTP::Request or its body:

require "slack"

request = HTTP::Request.new "POST", "/", body: "token=..."
command = Slack::SlashCommand.from_request(request)
puts command.text

You can create a message and send it using either webhooks or the chat.postMessage API:

require "slack"

message = Slack::Message.new("some_text", channel: "some_channel")

# send to webhook
message.send_to_hook "https://hooks.slack.com/services/..."

# send using the chat.postMessage API
api = Slack::API.new "some_token"
api.post_message(message)

More complex messages are supported. Please check the Message class. You can also get the users and channels given an token.

If you wish to configure the upstream slack host, you may do so

require "slack"

Slack::API.slack_host = "enterprise.slack.com" # Defaults to "slack.com"

Todo

Lots of API methods are missing!

Contributing

  1. Fork it ( https://github.com/manastech/crystal_slack/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

More Repositories

1

webmock.cr

Mock HTTP::Client
Crystal
103
star
2

crystal_ruby

Write Ruby extensions in Crystal
Crystal
99
star
3

frank

A small Sinatra clone for Crystal
Crystal
77
star
4

middleman-search

LunrJS-based search for Middleman
Ruby
58
star
5

handbook

Manas Handbook
CSS
22
star
6

crocoa

Cocoa for crystal
Crystal
20
star
7

benchy

A tool to perform benchmarks
Crystal
15
star
8

rancher-autoredeploy

Autoredeploy images on Docker Hub webhook pushes in Rancher
Crystal
15
star
9

includes-count

Ruby
14
star
10

crystal_redis

Redis client for Crystal
Crystal
14
star
11

atom-crystal-tools

Atom package that integrates crystal tools
CoffeeScript
10
star
12

listings

Simple creation of listings in rails applications
Ruby
5
star
13

fig-dns

DNS server for Docker containers managed by Fig
JavaScript
5
star
14

licit

Apply public licenses to files in ruby projects
Ruby
5
star
15

conan

Fast and lightweight framework to collect system metrics
Crystal
5
star
16

erl_csv_generator

Generate CSV files in Erlang
Erlang
4
star
17

mitm.cr

HTTP/S proxy server to intercept and inspect calls
Crystal
4
star
18

biocrystal

BioCrystal
Crystal
4
star
19

cafa5

Jupyter Notebook
4
star
20

erl-dbmodel

Erlang
3
star
21

d3-charts

Experiments on charts with D3
JavaScript
3
star
22

triangles

Counting triangles problem solved in May 2009
Java
2
star
23

dist

Generate packages to distribute Rails applications
Ruby
2
star
24

env_rails

Set Rails configuration parameters using environment variables
Ruby
2
star
25

pill-input

html based input with text and pills
JavaScript
2
star
26

rails-view_components

Simple library for building view components in Rails
Ruby
1
star
27

de-bee

De-Bee gives you a really simple way to deal with "I owe you"s and expense sharing for groups.
Python
1
star
28

knockout_forms-rails

Knockoutjs powered form builder for Rails
Ruby
1
star
29

rancher-zabbix-agent

Shell
1
star
30

stable-rails

Ruby
1
star
31

svg-input

SVG based input with pills support
JavaScript
1
star
32

ci-docker-builder

Scripts to facilitate building Docker images with right tags
Shell
1
star
33

cet-instagram

Utilitario para contactar inscriptas en Comunidad CET vĂ­a Instagram
Python
1
star
34

crystal-circleci-orb

Common CircleCI tasks for the Crystal programming language
1
star
35

javadrone

AR.Drone Java API
Java
1
star
36

crystal-ml

A classic machine learning library for Crystal programming language
Crystal
1
star
37

crystal_brium

Access Brium's API using Crystal
Crystal
1
star