Browse Source

Initial plumbing for riotbot

rxl881/riotbot
Richard Lewis 8 years ago
parent
commit
590cb011b0
  1. 1
      src/github.com/matrix-org/go-neb/goneb.go
  2. 37
      src/github.com/matrix-org/go-neb/services/riotbot/riotbot.go

1
src/github.com/matrix-org/go-neb/goneb.go

@ -26,6 +26,7 @@ import (
_ "github.com/matrix-org/go-neb/services/guggy"
_ "github.com/matrix-org/go-neb/services/imgur"
_ "github.com/matrix-org/go-neb/services/jira"
_ "github.com/matrix-org/go-neb/services/riotbot"
_ "github.com/matrix-org/go-neb/services/rssbot"
_ "github.com/matrix-org/go-neb/services/slackapi"
_ "github.com/matrix-org/go-neb/services/travisci"

37
src/github.com/matrix-org/go-neb/services/riotbot/riotbot.go

@ -0,0 +1,37 @@
// Package riotbot implements a Service for user onboarding in Riot.
package riotbot
import (
"github.com/matrix-org/go-neb/types"
"github.com/matrix-org/gomatrix"
)
// ServiceType of the Riotbot service
const ServiceType = "riotbot"
// Service represents the Riotbot service. It has no Config fields.
type Service struct {
types.DefaultService
}
// Commands supported:
// !help some request
// Responds with some user help.
func (e *Service) Commands(cli *gomatrix.Client) []types.Command {
return []types.Command{
types.Command{
Path: []string{"help"},
Command: func(roomID, userID string, args []string) (interface{}, error) {
return &gomatrix.TextMessage{"m.notice", "I can't help you with that"}, nil
},
},
}
}
func init() {
types.RegisterService(func(serviceID, serviceUserID, webhookEndpointURL string) types.Service {
return &Service{
DefaultService: types.NewDefaultService(serviceID, serviceUserID, ServiceType),
}
})
}
Loading…
Cancel
Save