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

Loading…
Cancel
Save