()
| 242 | } |
| 243 | |
| 244 | function assertPayloadKeyword() { |
| 245 | const payload = useContext().payload as IssueCommentEvent | PullRequestReviewCommentEvent |
| 246 | const body = payload.comment.body.trim() |
| 247 | if (!body.match(/(?:^|\s)(?:\/opencode|\/oc)(?=$|\s)/)) { |
| 248 | throw new Error("Comments must mention `/opencode` or `/oc`") |
| 249 | } |
| 250 | } |
| 251 | |
| 252 | function getReviewCommentContext() { |
| 253 | const context = useContext() |