All Projects → DougEverly → slack.cr

DougEverly / slack.cr

Licence: MIT License
Slack Real Time Messaging API in Crystal

Programming Languages

crystal
512 projects

Labels

Projects that are alternatives of or similar to slack.cr

slag
slack in the terminal using javascript
Stars: ✭ 16 (-5.88%)
Mutual labels:  slack
slackify-markdown
Convert markdown into Slack-specific markdown
Stars: ✭ 80 (+370.59%)
Mutual labels:  slack
slack-emoji-enlarger
A command-line tool to enlarge and split an image or gif into tiles and auto-upload each as a slack emoji to create the illusion of an enlarged slack emoji
Stars: ✭ 23 (+35.29%)
Mutual labels:  slack
jarjar
Python utility for sending slack notifications to your teams
Stars: ✭ 19 (+11.76%)
Mutual labels:  slack
slack-emoji-for-techies
100s of Slack emoji, many tech-related
Stars: ✭ 123 (+623.53%)
Mutual labels:  slack
slack-howdoi
☁️ Slack integration with the howdoi library
Stars: ✭ 43 (+152.94%)
Mutual labels:  slack
SlackStream
An all-at-a-glance Slack client that aggregates all channels and workspaces at one place
Stars: ✭ 40 (+135.29%)
Mutual labels:  slack
messaging-apis
Messaging APIs for multi-platform
Stars: ✭ 1,759 (+10247.06%)
Mutual labels:  slack
slack logger backend
An Elixir logger backend for posting errors to Slack.
Stars: ✭ 31 (+82.35%)
Mutual labels:  slack
prox
🙈 Share anonymous confessions in Slack
Stars: ✭ 28 (+64.71%)
Mutual labels:  slack
iou-slack-bot
💸 IOU Slack Bot - Keep track of your debts with your peers.
Stars: ✭ 13 (-23.53%)
Mutual labels:  slack
slack-rota
日々のローテーションをお知らせする Slack アプリ
Stars: ✭ 14 (-17.65%)
Mutual labels:  slack
electronim
Electron based multi IM (Instant Messaging) client
Stars: ✭ 50 (+194.12%)
Mutual labels:  slack
ben
Fast, native*, cross-platform Slack client, develop with React QML
Stars: ✭ 19 (+11.76%)
Mutual labels:  slack
WebsocketClientLite.PCL
websocket Client Lite PCL - Xaramrin
Stars: ✭ 22 (+29.41%)
Mutual labels:  slack
Perfect-Authentication
OAuth2 Implementations with Facebook, Google, LinkedIn, Slack, SalesForce and GitHub providers.
Stars: ✭ 14 (-17.65%)
Mutual labels:  slack
terraform-aws-ecs-cloudwatch-sns-alarms
Terraform module to create CloudWatch Alarms on ECS Service level metrics.
Stars: ✭ 23 (+35.29%)
Mutual labels:  slack
slack-rs-api
Rust interface for the Slack Web API
Stars: ✭ 94 (+452.94%)
Mutual labels:  slack
nomad-toast
A tool for receiving notifications based on HashiCorp Nomad events.
Stars: ✭ 40 (+135.29%)
Mutual labels:  slack
slack-mock
A Slack API mocker for Slack bot integration tests.
Stars: ✭ 61 (+258.82%)
Mutual labels:  slack

Slack Real Time API client written in Crystal

Build Status

Client to Slack's Real Time API written in Crystal and using WebSockets.

Still early in development.

Installation

Add this to your application's shard.yml:

dependencies:
  slack:
    github: DougEverly/slack.cr

Usage

require "slack"

Samples

Look in samples directory for example usage.

Example

require "../src/slack.cr"
slack = Slack.new(token: ENV["SLACK_TOKEN"])

slack.on(Slack::Event::Message) do |session, event|
  if event = event.as?(Slack::Event::Message)
    if session.me.as?(User)
      puts "Here as User! #{event.class.to_s} #{event.test}"
      if event.mentions(session.me)
        x = event.reply(text: "oh hi there")
        session.send x
      end

      if event.mentions("good morning", "good evening")
        if event.mentions(session.me)
          x = event.reply(text: "<@#{event.user}>: to you too!")
        else
          x = event.reply(text: "thank you!")
        end
        session.send x
      end
    end
  end
end

slack.on(Slack::Event::UserTyping) do |session, event|
  puts "someone is typing"
end

slack.on(Slack::Event::StarAdded) do |session, event|
  puts "starred"
end

slack.on(Slack::Event::PinAdded) do |session, event|
  puts "pin added"
end

slack.on(Slack::Reconnect) do |session, event|
  puts "pin added"
end

slack.start

Contributing

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

Contributors

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].