|  |  |  | @ -65,20 +65,24 @@ export function handleTaskCommand(body: string, sender: string, groupId: string, | 
		
	
		
			
				|  |  |  |  |           const taskId = validateTaskId(args[0]); | 
		
	
		
			
				|  |  |  |  |           const task = getTaskById(taskId); | 
		
	
		
			
				|  |  |  |  |            | 
		
	
		
			
				|  |  |  |  |         if (!task) { | 
		
	
		
			
				|  |  |  |  |           sendMessage(sender, `Tarea ${taskId} no encontrada`); | 
		
	
		
			
				|  |  |  |  |           return; | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |           if (!task) { | 
		
	
		
			
				|  |  |  |  |             sendMessage(sender, `Tarea ${taskId} no encontrada`); | 
		
	
		
			
				|  |  |  |  |             return; | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |            | 
		
	
		
			
				|  |  |  |  |         // Check if task is assigned to current user
 | 
		
	
		
			
				|  |  |  |  |         const currentUser = `@${sender.split('@')[0]}`; | 
		
	
		
			
				|  |  |  |  |         if (task.assignedTo !== currentUser) { | 
		
	
		
			
				|  |  |  |  |           sendMessage(sender, `No puedes completar la tarea ${taskId} porque no está asignada a ti`); | 
		
	
		
			
				|  |  |  |  |           return; | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |           // Check if task is assigned to current user
 | 
		
	
		
			
				|  |  |  |  |           const currentUser = `@${sender.split('@')[0]}`; | 
		
	
		
			
				|  |  |  |  |           if (task.assignedTo !== currentUser) { | 
		
	
		
			
				|  |  |  |  |             sendMessage(sender, `No puedes completar la tarea ${taskId} porque no está asignada a ti`); | 
		
	
		
			
				|  |  |  |  |             return; | 
		
	
		
			
				|  |  |  |  |           } | 
		
	
		
			
				|  |  |  |  |            | 
		
	
		
			
				|  |  |  |  |         completeTask(parseInt(taskId)); | 
		
	
		
			
				|  |  |  |  |         sendMessage(sender, `✅ Tarea ${taskId} completada: ${task.description}`); | 
		
	
		
			
				|  |  |  |  |           completeTask(taskId); | 
		
	
		
			
				|  |  |  |  |           sendMessage(sender, `✅ Tarea ${taskId} completada: ${task.description}`); | 
		
	
		
			
				|  |  |  |  |         } catch (error) { | 
		
	
		
			
				|  |  |  |  |           console.error('Error completing task:', error); | 
		
	
		
			
				|  |  |  |  |           sendMessage(sender, `❌ Error al completar tarea: ${error.message}`); | 
		
	
		
			
				|  |  |  |  |         } | 
		
	
		
			
				|  |  |  |  |       } else if (action === 'mostrar' || !action) { | 
		
	
		
			
				|  |  |  |  |         // Handle /tarea or /tarea mostrar
 | 
		
	
		
			
				|  |  |  |  |         const user = `@${sender.split('@')[0]}`; // Default to the sender
 | 
		
	
	
		
			
				
					|  |  |  | 
 |