|
|
|
@@ -3,6 +3,7 @@ package wechat |
|
|
|
import ( |
|
|
|
"code.gitea.io/gitea/models" |
|
|
|
"code.gitea.io/gitea/modules/log" |
|
|
|
"code.gitea.io/gitea/modules/setting" |
|
|
|
"encoding/json" |
|
|
|
"github.com/patrickmn/go-cache" |
|
|
|
"strings" |
|
|
|
@@ -70,12 +71,12 @@ func GetAutomaticReply(msg string) *AutomaticResponseContent { |
|
|
|
|
|
|
|
func loadAutomaticReplyFromDisk() ([]*AutomaticResponseContent, error) { |
|
|
|
log.Debug("LoadAutomaticResponseMap from disk") |
|
|
|
repo, err := models.GetRepositoryByOwnerAndAlias("OpenIOSSG", "promote") |
|
|
|
repo, err := models.GetRepositoryByOwnerAndAlias(setting.UserNameOfAutoReply, setting.RepoNameOfAutoReply) |
|
|
|
if err != nil { |
|
|
|
log.Error("get notice repo failed, error=%v", err) |
|
|
|
return nil, err |
|
|
|
} |
|
|
|
repoFile, err := models.ReadLatestFileInRepo("OpenIOSSG", repo.Name, "master", "wechat/auto_reply.json") |
|
|
|
repoFile, err := models.ReadLatestFileInRepo(setting.UserNameOfAutoReply, repo.Name, setting.RefNameOfAutoReply, setting.TreePathOfAutoReply) |
|
|
|
if err != nil { |
|
|
|
log.Error("GetNewestNotice failed, error=%v", err) |
|
|
|
return nil, err |
|
|
|
|