diff --git a/modules/question_setter.py b/modules/question_setter.py index c4e62f2..2773d53 100644 --- a/modules/question_setter.py +++ b/modules/question_setter.py @@ -8,7 +8,7 @@ Review request, @reviewer, @feedback, @feedback-sketch Request a review on an answer you wrote/edited On Rob Miles's Discord server, an `@editor` can ask other `@editor`s and `@reviewer`s to give them feedback or review their changes to AI Safety Info questions. You just put one or more links to appropriate GDocs and mention one of: `@reviewer`, `@feedback`, or `@feedback-sketch`. Stampy will spot this and update their statuses in the coda table with answers appropriately. -`@reviewer ` - change status to `In review` +`@reviewer ` - tag the article as `In review` `@feedback ` - change status to `In progress` `@feedback-sketch ` - change status to `Bulletpoint sketch` @@ -182,9 +182,20 @@ def parse_review_request(self, message: ServiceMessage) -> Optional[Response]: """ text = message.clean_content + # try parsing gdoc links and questions that have these gdoc links + # if you fail, assume this is not a review request + if not (gdoc_links := parse_gdoc_links(text)): + return + self.msg_id2gdoc_links[message.id] = gdoc_links + # get new status for questions if "@reviewer" in text: - status = "In review" + query = ("GDocLinks", gdoc_links) + return Response( + confidence=10, + callback=self.cb_edit_tag, + args=[query, "in-review", message, "add"], + ) elif "@feedback-sketch" in text: status = "Bulletpoint sketch" elif "@feedback" in text: @@ -192,12 +203,6 @@ def parse_review_request(self, message: ServiceMessage) -> Optional[Response]: else: # if neither of these three roles is mentioned, this is not a review request return - # try parsing gdoc links and questions that have these gdoc links - # if you fail, assume this is not a review request - if not (gdoc_links := parse_gdoc_links(text)): - return - self.msg_id2gdoc_links[message.id] = gdoc_links - return Response( confidence=10, callback=self.cb_review_request,