Gradii commited on
Commit
092a7c8
·
1 Parent(s): 2d188a5
Files changed (1) hide show
  1. index.js +2 -20
index.js CHANGED
@@ -414,30 +414,12 @@ async function handleAnalysis(
414
  .setColor(embedColor)
415
  .setTitle("🛡️ Wynik Analizy Treści")
416
  .setDescription(`**Werdykt:** ${verdictText}`)
417
- .addFields(
418
- {
419
- name: "Pewność modelu",
420
- value: `\`${confidencePercent}%\` \n${progressBar}`,
421
- },
422
- {
423
- name: "Czas przetwarzania",
424
- value: `\`${data.analysis_time.toFixed(3)}s\``,
425
- inline: true,
426
- },
427
- { name: "Użyty model", value: `\`${data.used_model}\``, inline: true },
428
- {
429
- name: "Format danych",
430
- value: `\`${data.content_type.toUpperCase()}\``,
431
- inline: true,
432
- },
433
- )
434
  .setTimestamp()
435
  .setFooter({
436
  text: "Deepfake Detection Service",
437
  iconURL: client.user.displayAvatarURL(),
438
  });
439
 
440
- // DYNAMICZNE RENDEROWANIE EMBEDA: Multi-Model vs Single-Model
441
  if (data.details && data.details.length > 0) {
442
  // Widok dla Multi-Modelu: ładnie listujemy każdy model
443
  embed.addFields({ name: "📊 Średnia pewność systemu", value: `\`${confidencePercent}%\``, inline: false });
@@ -454,7 +436,7 @@ async function handleAnalysis(
454
  });
455
  }
456
  } else {
457
- // Standardowy widok dla pojedynczego modelu
458
  const progressBar = getProgressBar(data.confidence, data.is_deepfake);
459
  embed.addFields(
460
  { name: "Pewność modelu", value: `\`${confidencePercent}%\` \n${progressBar}` },
@@ -462,7 +444,7 @@ async function handleAnalysis(
462
  );
463
  }
464
 
465
- // Dodatkowe pola wspólne
466
  embed.addFields(
467
  { name: "Czas przetwarzania", value: `\`${data.analysis_time.toFixed(3)}s\``, inline: true },
468
  { name: "Format danych", value: `\`${data.content_type.toUpperCase()}\``, inline: true }
 
414
  .setColor(embedColor)
415
  .setTitle("🛡️ Wynik Analizy Treści")
416
  .setDescription(`**Werdykt:** ${verdictText}`)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
417
  .setTimestamp()
418
  .setFooter({
419
  text: "Deepfake Detection Service",
420
  iconURL: client.user.displayAvatarURL(),
421
  });
422
 
 
423
  if (data.details && data.details.length > 0) {
424
  // Widok dla Multi-Modelu: ładnie listujemy każdy model
425
  embed.addFields({ name: "📊 Średnia pewność systemu", value: `\`${confidencePercent}%\``, inline: false });
 
436
  });
437
  }
438
  } else {
439
+ // Standardowy widok dla pojedynczego modelu (progressBar jest bezpiecznie zdefiniowany tutaj)
440
  const progressBar = getProgressBar(data.confidence, data.is_deepfake);
441
  embed.addFields(
442
  { name: "Pewność modelu", value: `\`${confidencePercent}%\` \n${progressBar}` },
 
444
  );
445
  }
446
 
447
+ // 3. Dodatkowe pola wspólne (dodawane tylko raz na samym końcu)
448
  embed.addFields(
449
  { name: "Czas przetwarzania", value: `\`${data.analysis_time.toFixed(3)}s\``, inline: true },
450
  { name: "Format danych", value: `\`${data.content_type.toUpperCase()}\``, inline: true }