|
|
|
@ -167,24 +167,16 @@ export class CommandService {
|
|
|
|
|
|
|
|
|
|
|
|
const responses: CommandResponse[] = [];
|
|
|
|
const responses: CommandResponse[] = [];
|
|
|
|
|
|
|
|
|
|
|
|
// 1) Ack al creador, salvo que él sea el único asignado
|
|
|
|
// 1) Ack al creador siempre, en una sola línea con id y descripción
|
|
|
|
const creatorIsOnlyAssignee = assignmentUserIds.length === 1 && assignmentUserIds[0] === createdBy;
|
|
|
|
|
|
|
|
if (!creatorIsOnlyAssignee) {
|
|
|
|
|
|
|
|
responses.push({
|
|
|
|
responses.push({
|
|
|
|
recipient: createdBy,
|
|
|
|
recipient: createdBy,
|
|
|
|
message:
|
|
|
|
message: `✅ Tarea ${taskId} creada: "${description || '(sin descripción)'}"`,
|
|
|
|
`✅ Tarea ${taskId} creada:\n` +
|
|
|
|
|
|
|
|
`• ${description || '(sin descripción)'}\n` +
|
|
|
|
|
|
|
|
(dueDate ? `• Vence: ${dueDate}\n` : '') +
|
|
|
|
|
|
|
|
(assignmentUserIds.length
|
|
|
|
|
|
|
|
? `• Asignados: ${assignmentUserIds.map((uid, idx) => `${assignedDisplayNames[idx] || uid} (@${uid})`).join(', ')}`
|
|
|
|
|
|
|
|
: ''),
|
|
|
|
|
|
|
|
mentions: mentionsForSending.length > 0 ? mentionsForSending : undefined
|
|
|
|
mentions: mentionsForSending.length > 0 ? mentionsForSending : undefined
|
|
|
|
});
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// 2) DM a cada asignado
|
|
|
|
// 2) DM a cada asignado (excluyendo al creador para evitar duplicados)
|
|
|
|
for (const uid of assignmentUserIds) {
|
|
|
|
for (const uid of assignmentUserIds) {
|
|
|
|
|
|
|
|
if (uid === createdBy) continue;
|
|
|
|
responses.push({
|
|
|
|
responses.push({
|
|
|
|
recipient: uid,
|
|
|
|
recipient: uid,
|
|
|
|
message:
|
|
|
|
message:
|
|
|
|
|