{"id":23488391,"url":"https://github.com/spy16/skit","last_synced_at":"2025-07-16T03:32:51.710Z","repository":{"id":57511308,"uuid":"159383782","full_name":"spy16/skit","owner":"spy16","description":"Build slack bots quickly and easily!","archived":false,"fork":false,"pushed_at":"2021-01-14T16:09:40.000Z","size":51,"stargazers_count":44,"open_issues_count":0,"forks_count":0,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-06-26T23:58:49.632Z","etag":null,"topics":["bot-framework","chatbot","go","golang","slack","slack-bot"],"latest_commit_sha":null,"homepage":"","language":"Go","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/spy16.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-11-27T18:52:16.000Z","updated_at":"2025-03-25T01:11:19.000Z","dependencies_parsed_at":"2022-09-26T17:51:32.732Z","dependency_job_id":null,"html_url":"https://github.com/spy16/skit","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/spy16/skit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fskit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fskit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fskit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fskit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/spy16","download_url":"https://codeload.github.com/spy16/skit/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/spy16%2Fskit/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265479372,"owners_count":23773526,"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-framework","chatbot","go","golang","slack","slack-bot"],"created_at":"2024-12-24T23:10:54.296Z","updated_at":"2025-07-16T03:32:51.664Z","avatar_url":"https://github.com/spy16.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# skit\n\n[![GoDoc](https://godoc.org/github.com/spy16/skit?status.svg)](https://godoc.org/github.com/spy16/skit) [![Build Status](https://travis-ci.org/spy16/skit.svg?branch=master)](https://travis-ci.org/spy16/skit) [![Go Report Card](https://goreportcard.com/badge/github.com/spy16/skit)](https://goreportcard.com/report/github.com/spy16/skit)\n\nSkit is a simple tool/library written in Go (or `Golang`) for building Slack bots.\nSkit pre-compiled binary is good enough to build simple slack bots. For more complex\nusecases skit can be used as a library as well.\n\n## Installation\n\nSimply download the pre-built binary for your platform from the\n[Releases](https://github.com/spy16/skit/releases) section.\n\n\n## Usage\n\n### Pre-compiled Binary\n\nRelease archive will contain a `skit.toml` file with some sample handlers\nsetup. To run this default setup:\n\n1. Create a bot on slack by following [Documentation](https://api.slack.com/bot-users#creating-bot-user)\n2. Set slack token generated for the bot in `skit.toml`\n3. Run `skit -c skit.toml`\n4. Go to slack and find the bot which you created and chat!\n\n#### `skit.toml` configuration file\n\nFollowing `skit.toml` file can be used to setup a simple slack bot that\npasses any message sent to it to a shell script `bot.sh`. The output of\nthis script will be sent back as the response.\n\n```toml\ntoken = \"your-token-here\"\nlog_level = \"info\"\n\n[[handlers]]\nname = \"matcha_all\"\ntype = \"command\"\nmatch = [\n  \".*\"\n]\ncmd = \"./bot.sh\"\nargs = [\n  \"{{ .event.Text }}\"\n]\n```\n\nSee `examples/` for samples of different handler configurations.\n\n### As a library\n\nFollowing sample shows how to build a simple bot that echo's everything\nyou say to it!\n\n```go\nsk:= skit.New(\"your-token\", logrus.New())\nsk.Register(\"echo_all\", skit.SimpleHandler(\"{{.event.Text}}\",  \".*\"))\nsk.Listen(context.Background())\n```\n\n\n## Handlers\n\nA handler is an implementation of `skit.Handler` interface. A handler is responsible\nfor consuming event, processing and responding to it when applicable. Currently 3 types\nof handlers are available.\n\n### 1. `simple`\n\n- `simple` handler can be used to build simple regex based conversational bot.\n- Following sample shows how to configure `simple` handler:\n\n    ```toml\n    [[handlers]]\n    name = \"simple_bot\"\n    type = \"simple\"\n    match = [\n      \"my name is (?P\u003cname\u003e.*)\"\n    ]\n    message = \"Hello there {{ .name }}!\"\n    ```\n\n### 2. `command`\n\n- `command` handler can be used to delegate the message handling responsibility to external command\n- This allows building bots which are more complex than the ones built with `simple`\n- Following sample shows how to configure `command` handler:\n\n    ```toml\n    [[handlers]]\n    name = \"external_command\"\n    type = \"command\"\n    match = [\n      \".*\"\n    ]\n    cmd = \"./hello.sh\"\n    args = [\n      \"{{ .event.Text }}\"\n    ]\n    timeout = \"5s\"\n    ```\n\n### 3. `lua`\n\n- `lua` allows writing handlers using Lua script which will be executed using embedded [Gopher-Lua](https://gitter.im/yuin/gopher-lua)\n- Lua code will have access to skit instance and its APIs and can be used build complex bots.\n- You can provide paths to be added to `LUA_PATH` as `paths` in the following config.\n- In the config sample below, `source` can be any valid lua code. So you can put your handler code\n  in a file (e.g., `handler.lua`) under one of the `paths` and use `source=\"require('handler')\"` in\n  the handler config.\n- Following sample shows how to configure `lua` handler:\n\n    ```toml\n    [[handlers]]\n    name = \"lua_handler\"\n    type = \"lua\"\n    handler = \"handle_event\"\n    paths = []\n    source = \"\"\"\n      function handle_event(ctx, sk, event)\n        sk:SendText(ctx, \"Hello from Lua!\", event.Channel)\n        return true\n      end\n    \"\"\"\n    ```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspy16%2Fskit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fspy16%2Fskit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fspy16%2Fskit/lists"}