From 9cdd546ba6443b2d4f62652673ed9a0e4d8ec4f5 Mon Sep 17 00:00:00 2001 From: Kegan Dougal Date: Fri, 29 Jul 2016 16:45:11 +0100 Subject: [PATCH] Remove spurious !github command --- .../matrix-org/go-neb/services/github/github.go | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/src/github.com/matrix-org/go-neb/services/github/github.go b/src/github.com/matrix-org/go-neb/services/github/github.go index 6222e02..1ed5f88 100644 --- a/src/github.com/matrix-org/go-neb/services/github/github.go +++ b/src/github.com/matrix-org/go-neb/services/github/github.go @@ -10,7 +10,6 @@ import ( "golang.org/x/oauth2" "regexp" "strconv" - "strings" ) // Matches alphanumeric then a /, then more alphanumeric then a #, then a number. @@ -29,14 +28,7 @@ func (s *githubService) ServiceType() string { return "github" } func (s *githubService) RoomIDs() []string { return s.Rooms } func (s *githubService) Plugin(roomID string) plugin.Plugin { return plugin.Plugin{ - Commands: []plugin.Command{ - plugin.Command{ - Path: []string{"github"}, - Command: func(roomID, userID string, args []string) (interface{}, error) { - return &matrix.TextMessage{"m.notice", strings.Join(args, " ")}, nil - }, - }, - }, + Commands: []plugin.Command{}, Expansions: []plugin.Expansion{ plugin.Expansion{ Regexp: regexp.MustCompile(ownerRepoIssueRegex), @@ -69,6 +61,9 @@ func (s *githubService) Plugin(roomID string) plugin.Plugin { } } +// githubClient returns a github Client which can perform Github API operations. +// If `token` is empty, a non-authenticated client will be created. This should be +// used sparingly where possible as you only get 60 requests/hour like that (IP locked). func githubClient(token string) *github.Client { var tokenSource oauth2.TokenSource if token != "" {