{"id":18450298,"url":"https://github.com/jacob-ian/slap","last_synced_at":"2026-06-20T08:31:08.118Z","repository":{"id":225240252,"uuid":"765010386","full_name":"jacob-ian/slap","owner":"jacob-ian","description":"Easily build Slack Apps with Go","archived":false,"fork":false,"pushed_at":"2024-03-18T05:06:59.000Z","size":42,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-30T05:36:52.829Z","etag":null,"topics":["go","golang","slack","slack-bot"],"latest_commit_sha":null,"homepage":"https://pkg.go.dev/github.com/jacob-ian/slap","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jacob-ian.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-02-29T05:38:40.000Z","updated_at":"2024-03-18T05:11:22.000Z","dependencies_parsed_at":"2024-03-02T05:24:56.678Z","dependency_job_id":"d0d5a157-f600-4034-b700-6c7cf89a6249","html_url":"https://github.com/jacob-ian/slap","commit_stats":null,"previous_names":["jacob-ian/slap"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/jacob-ian/slap","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ian%2Fslap","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ian%2Fslap/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ian%2Fslap/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ian%2Fslap/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jacob-ian","download_url":"https://codeload.github.com/jacob-ian/slap/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jacob-ian%2Fslap/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34563535,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-20T02:00:06.407Z","response_time":98,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["go","golang","slack","slack-bot"],"created_at":"2024-11-06T07:24:37.920Z","updated_at":"2026-06-20T08:31:08.095Z","avatar_url":"https://github.com/jacob-ian.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Slap: Easily build Slack Apps with Go\n\nA Slack application framework inspired by [Slack's Bolt Framework](https://api.slack.com/bolt) and the `net/http` library.\n\n## Examples\n\n### Slash Commands\n```go\napp.RegisterCommand(\"/hi\", func(req *slap.CommandRequest) error {\n    // Respond with 200 and an ephemeral message immediately\n    req.AckWithAction(slap.CommandResponseAction{\n        ResponseType: slap.RespondEphemeral,\n        Text: \"Hi, how are you?\"\n    })\n\n    // Send another message!\n    channel, ts, err := req.Client.PostEphemeral(req.Payload.ChannelID, req.Payload.UserID, slack.MsgOptionText(\"You said: \" + req.Payload.Text))\n    if err != nil {\n        return err\n    }\n\n    // Open a modal!\n    res, err := req.Client.OpenView(req.Payload.TriggerID, slack.ModalViewRequest{ \n        Type: \"modal\",\n        CallbackID: \"form-modal\",\n        Title: \u0026slack.TextBlockObject{\n            Type: \"plain_text\",\n            Text: \"Form\"\n        }\n        ... \n    })\n\n    return nil\n})\n```\n### View Submissions\n```go\napp.RegisterViewSubmission(\"form-modal\", func(req *slap.ViewSubmissionRequest) error {\n    // Get a value from the view submission\n    text := req.Payload.View.State.Values[\"text-input\"][\"text-input\"]\n    if !isTextValid(text) {\n        // Respond with 200 and an error visible to the user\n        req.AckWithAction(slap.ViewResponseAction{\n            ResponseAction: slap.ViewResponseErrors,\n            Errors: map[string]string{\n                \"text-input\": \"Please input a valid sentence\"\n            }\n        })\n        return nil\n    }\n\n    // Close the modal stack using the \"clear\" response action\n    req.AckWithAction(slap.ViewResponseAction{\n        ResponseAction: slap.ViewResponseClear\n    })\n\n    // Do something with the text value - save it to a store with the user's ID\n    if err := store.save(req.Payload.User.ID, text); err != nil {\n        return err\n    }\n\n    return nil\n})\n\n```\n\n### Block Actions\n```go\napp.RegisterBlockAction(\"start-button\", func(req *slap.BlockActionRequest) error {\n    // Respond to Slack with 200\n    req.Ack()\n\n    // Open a modal!\n    res, err := req.Client.OpenView(req.Payload.TriggerID, slack.ModalViewRequest{ \n        Type: \"modal\",\n        CallbackID: \"form-modal\",\n        Title: \u0026slack.TextBlockObject{\n            Type: \"plain_text\",\n            Text: \"Form\"\n        }\n        ... \n    })\n\n    return nil\n})\n```\n\n### Events API\n```go\napp.RegisterEventHandler(\"message\", func(req *slap.EventRequest) error {\n    // Parse the inner Events API event\n    var message slack.MessageEvent\n    if err := json.Unmarshal(req.Payload.Event, \u0026message); err != nil {\n        return err\n    }\n\n    // Respond to Slack with 200\n    req.Ack()\n\n    // Ignore messages that your bot has sent or you will get stuck in recursive message hell\n    if message.BotId != \"\" {\n        return nil\n    }\n\n    // Do something with the message\n    slog.Info(\"Received message\", \"message\", message.Text)\n    _, _, err := req.Client.PostMessage(message.Channel, slack.MsgOptionText(\"You wrote: \" + message.Text, false))\n    if err != nil {\n        return err\n    }\n\n    return nil\n})\n```\n\n## Quick Start\n1. Create a Slack App at [api.slack.com/apps](https://api.slack.com/apps) and install it to your workspace (_Settings -\u003e Install App_)\n1. Set the following environment variables from your Slack App Settings\n    ```\n    export BOT_TOKEN={Settings -\u003e Install App -\u003e Bot User OAuth Token}\n    ```\n    ```\n    export SIGNING_SECRET={Settings -\u003e Basic Information -\u003e Signing Secret}\n    ```\n1. Add the following to your `main.go`\n    ```go\n    package main\n\n    import (\n        \"net/http\"\n        \"os\"\n\n        \"github.com/jacob-ian/slap\"\n    )\n\n    func main() {\n        router := http.NewServeMux()\n\n        app := slap.New(slap.Config{\n            Router: router,\n            BotToken: func(teamID string) (string, error) {\n                return os.Getenv(\"BOT_TOKEN\"), nil\n            },\n            SigningSecret: os.Getenv(\"SIGNING_SECRET\"),\n        })\n\n        app.RegisterCommand(\"/start\", func(req *slap.CommandRequest) error {\n            req.AckWithAction(slap.CommandResponseAction{\n                ResponseType: slap.RespondInChannel,\n                Text:         \"Hello world!\",\n            })\n            return nil\n        })\n\n        server := \u0026http.Server{\n            Addr:    \":4000\",\n            Handler: router,\n        }\n        panic(server.ListenAndServe())\n    }\n    ```\n1. Run `go run main.go`\n1. Use [ngrok](https://ngrok.com) to get a public URL for your local environment\n1. Update your Slack App Settings:\n    1. Slash Commands -\u003e Create New Command \n        - Command: `/start`\n        - Request URL: `https://{YOUR NGROK URL}/commands`\n1. Use the `/start` command in your Slack Client\n\n## Usage Guide\n### Slack API Settings\nTo use Slap, you will need to update your Slack App's settings at [api.slack.com/apps](https://api.slack.com/apps).\n#### Slash Commands\nFor all Slash Commands:\n- Request URL: `https://{YOUR PUBLIC URL}/commands`\n#### Interactivity \u0026 Shortcuts\n- Turn on Interactivity\n- Request URL: `https://{YOUR PUBLIC URL}/interactions`\n#### Event Subscriptions\n- Enable Events\n- Request URL: `https://{YOUR PUBLIC URL}/events`\n    - Slap will automatically complete URL verification\n### Multiple Workspace Distribution\nSlap supports app distribution to multiple workspaces with the `BotTokenGetter` in `slap.Config`:\n```go\napp := slap.New(slap.Config{\n    ...,\n    BotToken: func(teamID string) (string, error) {\n        token, err := db.GetBotTokenByTeamID(teamID)\n        if err != nil {\n            return \"\", err\n        }\n        return token, nil\n    }\n})\n```\nThis allows for the fetching of a workspace's bot token from your store by the workspace's Team ID, which is then used by the Slack API client.\n\n\n## To Do\n- [ ] Add shortcut support\n- [ ] Add `view_closed` support\n- [ ] Add `block_suggestion` support\n- [ ] Add support for Gorilla Mux\n- [ ] Add support for Echo\n\n## Special Thanks\n\nThank you to the contributors at [github.com/go-slack/slack](https://github.com/go-slack/slack) for creating and maintaining the Slack API client and types\nwhich are needed to make Slap work.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-ian%2Fslap","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjacob-ian%2Fslap","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjacob-ian%2Fslap/lists"}