|
|
@ -63,6 +63,12 @@ func (s *githubService) Plugin(roomID string) plugin.Plugin { |
|
|
|
desc *string |
|
|
|
) |
|
|
|
ownerRepo = args[0] |
|
|
|
o := strings.Split(ownerRepo, "/") |
|
|
|
if len(o) != 2 { |
|
|
|
return &matrix.TextMessage{"m.notice", |
|
|
|
`Usage: !github create owner/repo "issue title" "description"`}, nil |
|
|
|
} |
|
|
|
|
|
|
|
if len(args) == 2 { |
|
|
|
title = &args[1] |
|
|
|
} else if len(args) == 3 { |
|
|
@ -72,7 +78,6 @@ func (s *githubService) Plugin(roomID string) plugin.Plugin { |
|
|
|
joinedTitle := strings.Join(args[1:], " ") |
|
|
|
title = &joinedTitle |
|
|
|
} |
|
|
|
o := strings.Split(ownerRepo, "/") |
|
|
|
|
|
|
|
issue, res, err := cli.Issues.Create(o[0], o[1], &github.IssueRequest{ |
|
|
|
Title: title, |
|
|
|