|
|
|
|
@ -230,7 +230,6 @@ export class CommandService {
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: '_Este comando se usa en grupos. Prueba:_ `/t ver mis`'
|
|
|
|
|
}];
|
|
|
|
|
const task = TaskService.getTaskById(resolvedId)!;
|
|
|
|
|
if (!GroupSyncService.isGroupActive(context.groupId)) {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
@ -537,11 +536,12 @@ export class CommandService {
|
|
|
|
|
if (!task) {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `⚠️ Tarea ${codeId(id)} no encontrada.`
|
|
|
|
|
message: `⚠️ Tarea ${codeId(resolvedId)} no encontrada.`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
const enforce = String(process.env.GROUP_MEMBERS_ENFORCE || '').toLowerCase() === 'true';
|
|
|
|
|
if (task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
|
|
|
|
|
const task = TaskService.getTaskById(resolvedId);
|
|
|
|
|
if (task && task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: 'No puedes completar esta tarea porque no apareces como miembro activo del grupo.'
|
|
|
|
|
@ -553,7 +553,7 @@ export class CommandService {
|
|
|
|
|
if (res.status === 'not_found') {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `⚠️ Tarea ${codeId(id)} no encontrada.`
|
|
|
|
|
message: `⚠️ Tarea ${codeId(resolvedId)} no encontrada.`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
if (res.status === 'already') {
|
|
|
|
|
@ -588,8 +588,9 @@ export class CommandService {
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
|
|
|
|
|
lines.push(`🚫 ${codeId(id)} — no permitido (no eres miembro activo).`);
|
|
|
|
|
const task = TaskService.getTaskById(resolvedId);
|
|
|
|
|
if (task && task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
|
|
|
|
|
lines.push(`🚫 ${codeId(resolvedId)} — no permitido (no eres miembro activo).`);
|
|
|
|
|
cntBlocked++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
@ -665,7 +666,7 @@ export class CommandService {
|
|
|
|
|
if (!task) {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `⚠️ Tarea ${codeId(id)} no encontrada.`
|
|
|
|
|
message: `⚠️ Tarea ${codeId(resolvedId)} no encontrada.`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
const enforce = String(process.env.GROUP_MEMBERS_ENFORCE || '').toLowerCase() === 'true';
|
|
|
|
|
@ -682,7 +683,7 @@ export class CommandService {
|
|
|
|
|
if (res.status === 'not_found') {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `⚠️ Tarea ${codeId(id)} no encontrada.`
|
|
|
|
|
message: `⚠️ Tarea ${codeId(resolvedId)} no encontrada.`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
if (res.status === 'completed') {
|
|
|
|
|
@ -727,7 +728,7 @@ export class CommandService {
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (task.group_id && GroupSyncService.isSnapshotFresh(task.group_id) && enforce && !GroupSyncService.isUserActiveInGroup(context.sender, task.group_id)) {
|
|
|
|
|
lines.push(`🚫 ${codeId(id)} — no permitido (no eres miembro activo).`);
|
|
|
|
|
lines.push(`🚫 ${codeId(resolvedId)} — no permitido (no eres miembro activo).`);
|
|
|
|
|
cntBlocked++;
|
|
|
|
|
continue;
|
|
|
|
|
}
|
|
|
|
|
@ -790,7 +791,7 @@ export class CommandService {
|
|
|
|
|
if (!task) {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `⚠️ Tarea ${codeId(id)} no encontrada.`
|
|
|
|
|
message: `⚠️ Tarea ${codeId(resolvedId)} no encontrada.`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
const enforce = String(process.env.GROUP_MEMBERS_ENFORCE || '').toLowerCase() === 'true';
|
|
|
|
|
@ -807,19 +808,19 @@ export class CommandService {
|
|
|
|
|
if (res.status === 'not_found') {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `⚠️ Tarea ${codeId(id)} no encontrada.`
|
|
|
|
|
message: `⚠️ Tarea ${codeId(resolvedId)} no encontrada.`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
if (res.status === 'completed') {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `ℹ️ ${codeId(id)} ya estaba completada — ${res.task?.description || '(sin descripción)'}${due}`
|
|
|
|
|
message: `ℹ️ ${codeId(resolvedId, res.task?.display_code)} ya estaba completada — ${res.task?.description || '(sin descripción)'}${due}`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
if (res.status === 'not_assigned') {
|
|
|
|
|
return [{
|
|
|
|
|
recipient: context.sender,
|
|
|
|
|
message: `ℹ️ ${codeId(id)} no la tenías asignada — ${res.task?.description || '(sin descripción)'}${due}`
|
|
|
|
|
message: `ℹ️ ${codeId(resolvedId, res.task?.display_code)} no la tenías asignada — ${res.task?.description || '(sin descripción)'}${due}`
|
|
|
|
|
}];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|