slackbotcmd
Description
slackbotのplugin開発支援ツール
Usage
$ slackbotcmd --help
NAME:
slackbotcmd -
USAGE:
slackbotcmd [global options] command [command options] [arguments...]
VERSION:
0.1.0
AUTHOR(S):
kyokomi
COMMANDS:
new
help, h Shows a list of commands or help for one command
GLOBAL OPTIONS:
--help, -h show help
--version, -v print the version
Example
$ slackbotcmd new --pkg cron
Output:
package cron
import (
"github.com/kyokomi/slackbot/plugins"
"golang.org/x/net/context"
)
type pluginKey string
func init() {
plugins.AddPlugin(pluginKey("cronMessage"), CronMessage{})
}
type CronMessage struct {
}
func (r CronMessage) CheckMessage(ctx context.Context, message string) (bool, string) {
// TODO: execute message check
return true, message
}
func (r CronMessage) DoAction(ctx context.Context, message string) bool {
// TODO: message action
//plugins.SendMessage(ctx, message)
return true // next ok
}
var _ plugins.BotMessagePlugin = (*CronMessage)(nil)
Install
To install, use go get
:
$ go get -d github.com/kyokomi/slackbot/cmd/slackbotcmd
Contribution
- Fork (https://github.com/kyokomi/slackbotcmd/fork)
- Create a feature branch
- Commit your changes
- Rebase your local changes against the master branch
- Run test suite with the
go test ./...
command and confirm that it passes
- Run
gofmt -s
- Create a new Pull Request
Author
kyokomi