Limpeza 2

Signed-off-by: Rodrigo B. de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
rodrigo committed 2025-08-08 10:35:55 -03:00
1 parent a88ee59f0d
commit d4c37a3f78
8 files changed
-610

No files matched your search

-60
View File
@@ -1,60 +0,0 @@
// Teste específico para debug do comando "ver sinal"
const BotHandler = require('./src/bot/handler');
// Mock do bot do Telegram
const mockBot = {
sendMessage: async (chatId, message, options) => {
console.log(`📤 MENSAGEM ENVIADA para chat ${chatId}:`);
console.log(` Texto: ${message}`);
if (options) {
console.log(` Opções: ${JSON.stringify(options, null, 2)}`);
}
console.log('');
return { message_id: Date.now() };
}
};
async function testVerSinal() {
console.log('🧪 Testando comando "ver sinal" diretamente...\n');
// Criar handler
const handler = new BotHandler(mockBot);
// Testar método handleVerSinal diretamente
console.log('🎯 Teste 1: Chamando handleVerSinal diretamente');
console.log(' Serial: DACM91569513');
console.log(' ChatId: 123456789\n');
try {
await handler.handleVerSinal(123456789, 'DACM91569513');
console.log('✅ Método handleVerSinal executado sem erros');
} catch (error) {
console.error('❌ Erro no handleVerSinal:', error);
}
console.log('\n🧠 Teste 2: Testando processamento NLP');
const intent = handler.nlp.processMessage('ver sinal DACM91569513');
console.log(' Intent detectado:', intent);
console.log('\n⚙️ Teste 3: Testando executeAction');
const mockUser = { first_name: 'Teste', id: 123456789 };
try {
await handler.executeAction(123456789, intent, mockUser);
console.log('✅ executeAction executado sem erros');
} catch (error) {
console.error('❌ Erro no executeAction:', error);
}
console.log('\n📋 Teste 4: Verificando OLTs disponíveis');
const olts = handler.ssh.listOLTs();
console.log(` OLTs encontradas: ${olts.length}`);
olts.forEach(olt => {
console.log(` - ${olt.id}: ${olt.name} (${olt.host})`);
});
console.log('\n✅ Teste de debug concluído!');
}
// Executar teste
testVerSinal().catch(console.error);