@@ -150,8 +150,7 @@ func (h *Handler) handleIssueComment(ctx context.Context, w http.ResponseWriter,
150
150
log .Infof ("Processing issue comment: issue=#%d, title=%s, comment_length=%d" ,
151
151
issueNumber , issueTitle , len (comment ))
152
152
153
- // 检查是否是 PR 评论(Issue 的 PullRequest 字段不为空)
154
- if event .Issue .PullRequestLinks != nil {
153
+ if event .Issue .IsPullRequest () {
155
154
log .Infof ("Detected PR comment for PR #%d" , issueNumber )
156
155
157
156
// 这是 PR 评论,处理 /continue 和 /fix 命令
@@ -200,16 +199,8 @@ func (h *Handler) handleIssueComment(ctx context.Context, w http.ResponseWriter,
200
199
}
201
200
}
202
201
203
- // Handle /code command for Issues only (not for PRs)
204
- if strings .HasPrefix (comment , "/code" ) {
205
- // Check if this is a PR comment, ignore if it is
206
- if event .Issue .PullRequestLinks != nil {
207
- log .Infof ("Ignoring /code command in PR #%d (use /continue or /fix instead)" , issueNumber )
208
- w .WriteHeader (http .StatusOK )
209
- w .Write ([]byte ("/code command is not supported in PRs, use /continue or /fix instead" ))
210
- return
211
- }
212
-
202
+ // Handle /code command for issues only (not for PRs)
203
+ if strings .HasPrefix (comment , "/code" ) && ! event .Issue .IsPullRequest () {
213
204
log .Infof ("Received /code command for Issue: %s, title: %s" ,
214
205
event .Issue .GetHTMLURL (), issueTitle )
215
206
0 commit comments