Skip to content

Commit

Permalink
fix: update command pattern
Browse files Browse the repository at this point in the history
remove starting /
  • Loading branch information
EresDev committed Jan 23, 2025
1 parent c8af5f6 commit 3ddb220
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/handlers/call-personal-agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,12 @@ export async function callPersonalAgent(context: Context, inputs: PluginInputs)
const body = payload.comment.body;
const repo = payload.repository.name;

if (!body.match(/^\/\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))\s.*/i)) {
if (!body.match(/^\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))\s.*/i)) {
logger.info(`Ignoring irrelevant comment: ${body}`);
return;
}

const targetUser = body.match(/^\/\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))/i);
const targetUser = body.match(/^\B@([a-z0-9](?:-(?=[a-z0-9])|[a-z0-9]){0,38}(?<=[a-z0-9]))/i);
if (!targetUser) {
logger.error(`Missing target username from comment: ${body}`);
return;
Expand Down

0 comments on commit 3ddb220

Please sign in to comment.