Skip to content
/ slash Public

Go library for creating Slack slash commands

License

Notifications You must be signed in to change notification settings

mfonda/slash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 

Repository files navigation

slash

slash is a Go library for creating Slack Slash Commands.

Disclaimer: I created this because I wanted to create a slash command, and I've been wanting to (re)learn Go so I figured this would be a good chance to do so. slash does not currently support all Slack slash command features. PRs are welcome, as well as any feedback on my probably-not-very-idiomatic Go code.

Example usage:

// Simple "echo command" to echo back a slack users command;
package main

import (
	"github.com/mfonda/slash"
	"log"
)

func main() {
	slash.HandleFunc("/echo", "secret-token", echo)
	log.Fatal(slash.ListenAndServeTLS(":443", "/path/to/cert", "/path/to/key"))
}

func echo(req *slash.Request) (*slash.Response, error) {
	return slash.NewInChannelResponse(req.Text, nil), nil
}

About

Go library for creating Slack slash commands

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages