Ignore comment not starting with a slash

This commit is contained in:
Ori Kotek 2024-02-21 17:59:58 +02:00
parent 7c87c9d3a5
commit 048d90623f
No known key found for this signature in database
GPG key ID: 5AAFD0757D1EAC4C

View file

@ -92,6 +92,9 @@ async def handle_request(body: Dict[str, Any], event: str):
if "comment" not in body:
return {}
comment_body = body.get("comment", {}).get("body")
if not comment_body.lsstrip().startswith("/"):
get_logger().info("Ignoring comment not starting with /")
return {}
if sender and bot_user in sender:
get_logger().info(f"Ignoring comment from {bot_user} user")
return {}