afina algunos formatos de mensajes, a ver si no petan los tests

pull/1/head
borja 2 months ago
parent 12d18322ff
commit e8e319afb0

@ -36,7 +36,7 @@ export class CommandService {
// Utilidades locales para operar con fechas en la TZ elegida sin depender del huso del host
const ymdFromDateInTZ = (d: Date): string => {
const fmt = new Intl.DateTimeFormat('en-GB', {
const fmt = new Intl.DateTimeFormat('es-ES', {
timeZone: TZ,
year: 'numeric',
month: '2-digit',
@ -172,10 +172,10 @@ export class CommandService {
'- Preferencias:',
' · `/t configurar daily|weekly|off` (hora por defecto 08:30; semanal: lunes 08:30)',
'- Notas:',
' · En grupos, el bot responde por DM al autor (no publica en el grupo).',
' · Si creas en grupo y no mencionas a nadie → “sin responsable”; en DM → se asigna al creador.',
' · En grupos, el bot responde por DM (no publica en el grupo).',
' · Si creas en grupo y no mencionas a nadie → “sin responsable”; en DM → se asigna a quien la cree.',
' · Fechas dd/MM con ⚠️ si está vencida.',
' · Mostramos los IDs con 4 dígitos, pero puedes escribirlos sin ceros (p. ej., 26).',
' · Mostramos los IDs de las tareas con 4 dígitos, pero puedes escribirlos sin ceros (p. ej., 26).',
].join('\n');
return [{
recipient: context.sender,
@ -184,9 +184,9 @@ export class CommandService {
}
const help = [
'Guía rápida:',
'- Crear: `/t n Descripción mañana @Ana`',
'- Ver grupo: `/t ver grupo`',
'- Ver mis: `/t ver mis`',
'- Crear: `/t n Descripción 2028-11-26 @Ana`',
'- Ver grupo: `/t ver` (en el grupo)',
'- Ver mis tareas: `/t ver mis` (por DM)',
'- Ver todos: `/t ver todos`',
'- Completar: `/t x 123`',
'- Configurar recordatorios: `/t configurar daily|weekly|off`'
@ -217,13 +217,13 @@ export class CommandService {
if (!isGroupId(context.groupId)) {
return [{
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)) {
return [{
recipient: context.sender,
message: '⚠️ Este grupo no está activo.'
message: '⚠️ _Este grupo no está activo._'
}];
}
const items = TaskService.listGroupUnassigned(context.groupId, LIMIT);
@ -232,7 +232,7 @@ export class CommandService {
if (items.length === 0) {
return [{
recipient: context.sender,
message: `No hay tareas sin responsable en ${groupName}.`
message: `_No hay tareas sin responsable en ${groupName}._`
}];
}
@ -304,13 +304,13 @@ export class CommandService {
sections.push(`… y ${totalMy - myItems.length} más`);
}
} else {
sections.push(italic('No tienes tareas pendientes.'));
sections.push(italic('_No tienes tareas pendientes._'));
}
// En contexto de grupo: mantener compatibilidad mostrando solo "sin responsable" del grupo actual
if (isGroupId(context.groupId)) {
if (!GroupSyncService.isGroupActive(context.groupId)) {
sections.push('⚠️ Este grupo no está activo.');
sections.push('⚠️ _Este grupo no está activo._');
} else {
const groupName = GroupSyncService.activeGroupsCache.get(context.groupId) || context.groupId;
const unassigned = TaskService.listGroupUnassigned(context.groupId, LIMIT);
@ -329,7 +329,7 @@ export class CommandService {
sections.push(`… y ${totalUnassigned - unassigned.length} más`);
}
} else {
sections.push(`${groupName} — Sin responsable\n(no hay tareas sin responsable)`);
sections.push(`${groupName} — Sin responsable\n_(no hay tareas sin responsable)_`);
}
}
} else {

Loading…
Cancel
Save