{"id":18820885,"url":"https://github.com/hashrocket/slack-command-api","last_synced_at":"2025-04-14T00:17:33.733Z","repository":{"id":30709165,"uuid":"34265257","full_name":"hashrocket/slack-command-api","owner":"hashrocket","description":"A Sinatra API for processing custom Slack commands","archived":false,"fork":false,"pushed_at":"2017-01-24T18:51:01.000Z","size":44,"stargazers_count":12,"open_issues_count":0,"forks_count":3,"subscribers_count":10,"default_branch":"master","last_synced_at":"2025-03-27T14:21:17.385Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hashrocket.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-20T14:26:52.000Z","updated_at":"2019-06-06T02:57:05.000Z","dependencies_parsed_at":"2022-08-23T04:40:51.929Z","dependency_job_id":null,"html_url":"https://github.com/hashrocket/slack-command-api","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashrocket%2Fslack-command-api","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashrocket%2Fslack-command-api/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashrocket%2Fslack-command-api/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hashrocket%2Fslack-command-api/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hashrocket","download_url":"https://codeload.github.com/hashrocket/slack-command-api/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248799960,"owners_count":21163404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-08T00:31:33.071Z","updated_at":"2025-04-14T00:17:33.710Z","avatar_url":"https://github.com/hashrocket.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slack Command API [![Deploy](https://www.herokucdn.com/deploy/button.png)](https://heroku.com/deploy?template=https://github.com/hashrocket/slack-command-api)\n\nThis Sinatra API converts custom Slack commands into Bot messages.\nThe API will post to your current channel by default, but you can specify a channel: `/late 10AM #another_channel`\n\nExample:\nA `/late 10AM` command converts to a text response **Hey team, I'm gonna be in around 10AM.**\n\n## Dependencies\n\n* RVM\n* Sinatra\n* Testing: RSpec\n\n## Getting Started\n1. `git clone` the app\n2. `cd` into the folder.\n3. Bundle the gems. `bundle install`\n4. Set your Slack webhook environment variable. Create a `.env` file. Populate it with a `SLACK_URL` variable for your app's incoming webhook.\n4. Run the app with `bundle exec passenger start`\n\n## Adding a New Command in 2 steps\n\nCreate a message object that constructs a message, gives the bot a name, and gives it an emoji.\n\n```\nclass YourCommandMessage\n\n  def construct_message(text, user_name)\n    \"This text will show up in Slack and can show the #{user_name} of who issued the command, along the #{text} of the command\"\n  end\n\n  # Your bot will be named 'Your-Command-Bot'\n  def bot_name\n    'Your-Command-Bot'\n  end\n\n  # This will show a whale icon for your chat bot\n  def icon_emoji\n   ':whale:'\n  end\nend\n```\n\nAdd a post url to `app.rb`\n\n```\n# ...\nrequire_relative 'your_command_message'\n# ...\npost '/your_command_url' do\n  response = Response.new(params, YourCommandMessage.new)\n  Slack.new(response).post\nend\n# ...\n```\n\nDone.\n\n## Testing\n1. Head to the spec folder. `cd spec`\n2. Run the tests with `rspec --color --format documentation`\n\n## Credits\nMaintainer: [Joshua Plicque](https://twitter.com/GoHard_EveryDay)\nIf you have any questions, send me a tweet.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashrocket%2Fslack-command-api","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhashrocket%2Fslack-command-api","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhashrocket%2Fslack-command-api/lists"}