{"id":18733271,"url":"https://github.com/autom8ter/slasher","last_synced_at":"2025-07-03T18:09:22.446Z","repository":{"id":140621241,"uuid":"235003174","full_name":"autom8ter/slasher","owner":"autom8ter","description":"slasher makes it easy to write http servers that respond to slack slash commands","archived":false,"fork":false,"pushed_at":"2020-01-22T00:53:48.000Z","size":1643,"stargazers_count":7,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-12T18:46:39.459Z","etag":null,"topics":["go","golang-library","slack","slack-commands"],"latest_commit_sha":null,"homepage":"","language":"Go","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/autom8ter.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2020-01-20T02:27:35.000Z","updated_at":"2023-03-05T06:10:31.000Z","dependencies_parsed_at":null,"dependency_job_id":"d212ef40-36a4-4da3-b6cf-d2f9cb9b1a23","html_url":"https://github.com/autom8ter/slasher","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/autom8ter/slasher","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fslasher","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fslasher/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fslasher/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fslasher/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/autom8ter","download_url":"https://codeload.github.com/autom8ter/slasher/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/autom8ter%2Fslasher/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263376125,"owners_count":23457333,"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":["go","golang-library","slack","slack-commands"],"created_at":"2024-11-07T15:09:14.299Z","updated_at":"2025-07-03T18:09:22.410Z","avatar_url":"https://github.com/autom8ter.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# slasher\n--\n    import \"github.com/autom8ter/slasher\"\n\n\n## Usage\n\n#### func  ExampleHandler\n\n```go\nfunc ExampleHandler()\n```\n\n#### type HandlerFunc\n\n```go\ntype HandlerFunc func(s *Slasher, client *slack.Client, command *slack.SlashCommand) (interface{}, error)\n```\n\nA handler func is run against an incoming slack slash command. It is up to the\nuser of this library to define their own handlers\n\n#### type Slasher\n\n```go\ntype Slasher struct {\n}\n```\n\nSlasher holds a slack client, a map of functions map[string]HandlerFunc and an\narray of allowed users\n\n#### func  NewSlasher\n\n```go\nfunc NewSlasher(token string) *Slasher\n```\nCreates a newe slasher instance\n\n#### func (*Slasher) AddHandler\n\n```go\nfunc (s *Slasher) AddHandler(command string, function HandlerFunc)\n```\nAdds a slack slash command handler\n\n#### func (*Slasher) BashScipt\n\n```go\nfunc (s *Slasher) BashScipt(script string) ([]byte, error)\n```\nruns exec.Command(\"/bin/sh\", \"-c\", script)\n\n#### func (*Slasher) CommandHandlers\n\n```go\nfunc (s *Slasher) CommandHandlers() []string\n```\nNames of all supported slash commands\n\n#### func (*Slasher) DeleteHandler\n\n```go\nfunc (s *Slasher) DeleteHandler(command string)\n```\nDeletes a handler delete(s.functions, command)\n\n#### func (*Slasher) Error\n\n```go\nfunc (s *Slasher) Error(w http.ResponseWriter, err error)\n```\nWrites a wrapped Slasher error to the response\n\n#### func (*Slasher) Exec\n\n```go\nfunc (s *Slasher) Exec(args ...string) ([]byte, error)\n```\nruns exec.Command(args[0], args[1:]...)\n\n#### func (*Slasher) Exists\n\n```go\nfunc (s *Slasher) Exists(command string) bool\n```\nChecks if a function exists for the command\n\n#### func (*Slasher) HandlerFunc\n\n```go\nfunc (s *Slasher) HandlerFunc() http.HandlerFunc\n```\n\n#### func (*Slasher) JSON\n\n```go\nfunc (s *Slasher) JSON(w http.ResponseWriter, obj interface{})\n```\nWrites pretty json to the response\n\n#### func (*Slasher) Python3Script\n\n```go\nfunc (s *Slasher) Python3Script(cmd string) ([]byte, error)\n```\nruns exec.Command(\"python3\", \"-c\", cmd)\n\n#### func (*Slasher) ShellScript\n\n```go\nfunc (s *Slasher) ShellScript(script string) ([]byte, error)\n```\nexec.Command(\"/bin/sh\", \"-c\", script)\n\n#### func (*Slasher) String\n\n```go\nfunc (s *Slasher) String(w http.ResponseWriter, response string)\n```\nWrites the string to the response\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautom8ter%2Fslasher","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fautom8ter%2Fslasher","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fautom8ter%2Fslasher/lists"}