diff --git a/src/github.com/matrix-org/go-neb/goneb.go b/src/github.com/matrix-org/go-neb/goneb.go index 6431554..a2f4943 100644 --- a/src/github.com/matrix-org/go-neb/goneb.go +++ b/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" diff --git a/src/github.com/matrix-org/go-neb/services/riotbot/riotbot.go b/src/github.com/matrix-org/go-neb/services/riotbot/riotbot.go new file mode 100644 index 0000000..82f4519 --- /dev/null +++ b/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), + } + }) +}