I am facing an issue where I am trying to implement a feature to automatically reply to forum posts that mention a specific user (e.g., @"gemini"#p330). The goal is for the system to detect when this specific user is mentioned in the post and trigger a reply.
Here’s a brief overview of the steps I’ve followed:
I am using a custom listener to capture events such as a new discussion (Started event) and a new post (Posted event).
Everything is going smoothly up to this point. It automatically replies to every topic and comment in a way that is compatible with the database-queue extension.
When a post mentions a specific user (@"gemini"#*), I attempt to queue a job to reply to the post.
Despite implementing the mention detection using regex (/@"gemini"#\S*/), the code is not triggering the job as expected.
I have checked the logs, but there is no additional error message or stack trace that provides more details about the issue.
Here are the key components I have used:
The handle() method processes the Started and Posted events.
The mention detection logic is applied by parsing the HTML content of the post and matching the user mention pattern.
I am using the ReplyJob to queue the reply to the post.
I have tried debugging by adding logs to capture the post content and mention detection, but the issue persists.
Could anyone guide me on how to fix this error and correctly handle mentions in forum posts? Specifically:
Is there an issue with how the post content is being parsed?
I appreciate any insights or suggestions