fix: corregir errores de sintaxis y alcance en CommandService

Co-authored-by: aider (openrouter/openai/gpt-5) <aider@aider.chat>
pull/1/head
brobert 1 month ago
parent 0e90dbfa0f
commit 9d3636b828

@ -72,6 +72,7 @@ export class CommandService {
dateCandidates.push({ index: i, ymd: low }); dateCandidates.push({ index: i, ymd: low });
dateTokenIndexes.add(i); dateTokenIndexes.add(i);
continue; continue;
}
} }
// Tokens naturales "hoy"/"mañana" (con o sin acento) // Tokens naturales "hoy"/"mañana" (con o sin acento)
@ -229,6 +230,7 @@ export class CommandService {
recipient: context.sender, recipient: context.sender,
message: '_Este comando se usa en grupos. Prueba:_ `/t ver mis`' message: '_Este comando se usa en grupos. Prueba:_ `/t ver mis`'
}]; }];
}
if (!GroupSyncService.isGroupActive(context.groupId)) { if (!GroupSyncService.isGroupActive(context.groupId)) {
return [{ return [{
recipient: context.sender, recipient: context.sender,
@ -539,7 +541,6 @@ export class CommandService {
}]; }];
} }
const enforce = String(process.env.GROUP_MEMBERS_ENFORCE || '').toLowerCase() === 'true'; const enforce = String(process.env.GROUP_MEMBERS_ENFORCE || '').toLowerCase() === 'true';
const task = TaskService.getTaskById(resolvedId);
if (task && task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) { if (task && task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
return [{ return [{
recipient: context.sender, recipient: context.sender,
@ -726,7 +727,8 @@ export class CommandService {
continue; continue;
} }
if (task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) { const task = TaskService.getTaskById(resolvedId);
if (task && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
lines.push(`🚫 ${codeId(resolvedId)} — no permitido (no eres miembro activo).`); lines.push(`🚫 ${codeId(resolvedId)} — no permitido (no eres miembro activo).`);
cntBlocked++; cntBlocked++;
continue; continue;

Loading…
Cancel
Save