{"id":25728370,"url":"https://github.com/kenjij/mos-eisley","last_synced_at":"2026-05-15T00:33:30.474Z","repository":{"id":56884550,"uuid":"104133648","full_name":"kenjij/mos-eisley","owner":"kenjij","description":"\"You will never find a more wretched hive of scum and villainy.\"","archived":false,"fork":false,"pushed_at":"2018-03-14T02:31:52.000Z","size":18,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-03-23T13:42:43.252Z","etag":null,"topics":["bot","ruby","server","slack"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kenjij.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-09-19T22:00:39.000Z","updated_at":"2021-07-27T18:54:58.000Z","dependencies_parsed_at":"2022-08-20T23:40:42.513Z","dependency_job_id":null,"html_url":"https://github.com/kenjij/mos-eisley","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fmos-eisley","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fmos-eisley/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fmos-eisley/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kenjij%2Fmos-eisley/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kenjij","download_url":"https://codeload.github.com/kenjij/mos-eisley/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":240766601,"owners_count":19854119,"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":["bot","ruby","server","slack"],"created_at":"2025-02-26T00:17:34.308Z","updated_at":"2026-05-15T00:33:30.437Z","avatar_url":"https://github.com/kenjij.png","language":"Ruby","funding_links":[],"categories":[],"sub_categories":[],"readme":"# mos-eisley\n\n[![Gem Version](https://badge.fury.io/rb/mos-eisley.svg)](http://badge.fury.io/rb/mos-eisley) [![Code Climate](https://codeclimate.com/github/kenjij/mos-eisley/badges/gpa.svg)](https://codeclimate.com/github/kenjij/mos-eisley) [![security](https://hakiri.io/github/kenjij/mos-eisley/master.svg)](https://hakiri.io/github/kenjij/mos-eisley/master)\n\nA Ruby based [Slack app](https://api.slack.com/slack-apps) server. It provides API endpoints to Slack as well as functions to access Slack API and manages events with handlers you create.\n\n## Environment\n\n- UNIX-like systems\n- [Ruby](https://www.ruby-lang.org/) \u003e= 2.1\n- [Sinatra](http://www.sinatrarb.com/) ~\u003e 2.0 – for inbound API server\n- [em-http-request](https://github.com/igrigorik/em-http-request) ~\u003e 1.1 – for outbound API access\n\n## Getting Started\n\nInstall the gem.\n\n    gem install mos-eisley\n\nCreate a configuration file and register some handlers. Handlers are your code that gets executed when events are received from Slack. See below for [more details](#).\n\nRun Mos Eisley.\n\n    mos-eisley -c config.rb start\n\n## Setup\n\n### Configuration File\n\nThis is a standard Ruby file and anything can go in it. It'll be executed at the very beginning of app launch, before the HTTP server is started. Here is an example.\n\n```ruby\n# Configure application logging\nMosEisley.logger = Logger.new(STDOUT)\nMosEisley.logger.level = Logger::DEBUG\n\n# Main configuration block (MosEisley namespace can be abbrv. to ME)\nME::Config.setup do |c|\n  # User custom data\n  c.user = {my_data1: 'Something', my_data2: 'Somethingelse'}\n\n  # HTTP server (Sinatra) settings\n  c.dump_errors = true\n  c.logging = true\n\n  # Your handlers\n  c.handler_paths = [\n    'handlers'\n  ]\n\n  # Slack info\n  c.verification_token = 'vErIf1c4t0k3n5'\n  c.bot_access_token = 'xoxb-1234567890-b0t4cCe5sToK3N'\nend\n```\n\n### Handlers\n\nDefine handlers, also a Ruby file, and they'll be executed as incoming Slack events are processed. You can define as many handlers as you want. You'll store the file(s) in the directory you've identified in the configuration file above.\n\nThere are 3 types of handlers you can define: `:action`, `:command`, `:event`, which corresponds to the MosEisley endpoints accordingly.\n\n```ruby\nME::Handler.add(:event, 'debug') do |e, h|\n  e.event.each { |k, v| puts \"#{k}: #{v}\" }\n  h.stop unless e.for_me?\nend\n\n```\n\n### Slack\n\nCreate an app in Slack to setup a bot. Following features can be setup.\n\n- **Interactive Components** – Request URL should be set to MosEisley's `/action` endpoint.\n- **Slash Commands** – Request URL should be set to MosEisley's `/command` endpoint.\n- **OAuth \u0026 Permission** – This is where you get the Bot User OAuth Access Token you need to set in the configuration file.\n- **Event Subscription** – Request URL should be set to MosEisley's `/event` endpoint. You'll likely Subscribe to Bot Events of `app_mention` or any of the `message.*` events.\n\n## CLI Usage\n\nTo see help:\n\n```\n$ mos-eisley -h\nUsage: mos-eisley [options] {start|stop}\n  -c, --config=\u003cs\u003e     Load config from file\n  -d, --daemonize      Run in the background\n  -l, --log=\u003cs\u003e        Log output to file\n  -P, --pid=\u003cs\u003e        Store PID to file\n  -p, --port=\u003ci\u003e       Use port (default: 4567)\n```\n\nThe minimum to start a server:\n\n```\n$ mos-eisley -c config.rb start\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fmos-eisley","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkenjij%2Fmos-eisley","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkenjij%2Fmos-eisley/lists"}