Skip to content

vicchirino/ruby-slack-bot

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Slack bot client

Little project to serve a slack client. The intention of this repo is to apply/learn how to serve a client in ruby.

Gems: • pumasinaraslack-ruby-client

Create a slack app

First of all you will need a slack app. This can be created in the slack web api dashboard https://api.slack.com/apps.

alt text

Then you will need to add some scopes in the slack app dashboard

alt_text

For the propuse of this repo we will need the scopes:

  • commands
  • mpim:write
  • im:write
  • chat:write

You can read more about slack app scopes here

Next step will be to install the app in one of your workspace (I recommend a testing workspace)

alt_text alt_text

Finally you need to create a slack slash command /hello Here you can read more about slash commands Set up command URL. (slack needs a https url, so i'm using ngrok to generate it) The URL need to finish with /slack since that is the endpoint that i'm using in api.rb.

alt_text

Run

In slack_client.rb update the SLACK_BOT_TOKEN with yours. For real word examples this should be secret and storaged in a different place.

Behind the repo run bundle exec puma --port <your-port> (your-port) should be same that you used for ngrok and slack urls.

About

Little slack bot, wrote in Ruby.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages