Gradii commited on
Commit
6e109e3
·
2 Parent(s): c0426da90c3e03

Merge branch 'main' into backend-setup

Browse files
Files changed (1) hide show
  1. index.js +48 -3
index.js CHANGED
@@ -445,12 +445,34 @@ client.on(Events.InteractionCreate, async (interaction) => {
445
  }
446
 
447
  if (interaction.customId === "reportError") {
448
- await interaction.reply({
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
449
  content: "✅ **Dziękujemy!** Twoje zgłoszenie błędu zostało zarejestrowane.",
450
  flags: [MessageFlags.Ephemeral]
451
  });
452
 
453
- console.log(`[RAPORT BŁĘDU] Użytkownik ${interaction.user.tag} (ID: ${interaction.user.id}) zgłosił błędną klasyfikację.`);
454
 
455
  const originalEmbed = interaction.message.embeds[0];
456
  if (originalEmbed) {
@@ -463,8 +485,31 @@ client.on(Events.InteractionCreate, async (interaction) => {
463
  }
464
  }
465
 
 
466
  if (interaction.customId === "modelCorrect") {
467
- await interaction.reply({
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  content: "✅ **Dziękujemy!** Twoje potwierdzenie zostało pomyślnie zapisane.",
469
  flags: [MessageFlags.Ephemeral]
470
  });
 
445
  }
446
 
447
  if (interaction.customId === "reportError") {
448
+ const disabledRow = new ActionRowBuilder().addComponents(
449
+ new ButtonBuilder()
450
+ .setCustomId("modelCorrect")
451
+ .setLabel("Model odpowiedział poprawnie")
452
+ .setStyle(ButtonStyle.Success)
453
+ .setEmoji("✅")
454
+ .setDisabled(true),
455
+ new ButtonBuilder()
456
+ .setCustomId("reportError")
457
+ .setLabel("Zgłoś błąd analizy")
458
+ .setStyle(ButtonStyle.Danger)
459
+ .setEmoji("⚠️")
460
+ .setDisabled(true)
461
+ );
462
+
463
+ // 2 UPDATE BUTTONS
464
+ await interaction.update({
465
+ embeds: [interaction.message.embeds[0]],
466
+ components: [disabledRow]
467
+ });
468
+
469
+ // 3 CONFIRMATION
470
+ await interaction.followUp({
471
  content: "✅ **Dziękujemy!** Twoje zgłoszenie błędu zostało zarejestrowane.",
472
  flags: [MessageFlags.Ephemeral]
473
  });
474
 
475
+ console.log(`[RAPORT BŁĘDU] Użytkownik ${interaction.user.tag} (ID: ${interaction.user.id}) zgłosił błąd klasyfikacji.`);
476
 
477
  const originalEmbed = interaction.message.embeds[0];
478
  if (originalEmbed) {
 
485
  }
486
  }
487
 
488
+ // CORRECT CLICK
489
  if (interaction.customId === "modelCorrect") {
490
+ const disabledRow = new ActionRowBuilder().addComponents(
491
+ new ButtonBuilder()
492
+ .setCustomId("modelCorrect")
493
+ .setLabel("Model odpowiedział poprawnie")
494
+ .setStyle(ButtonStyle.Success)
495
+ .setEmoji("✅")
496
+ .setDisabled(true),
497
+ new ButtonBuilder()
498
+ .setCustomId("reportError")
499
+ .setLabel("Zgłoś błąd analizy")
500
+ .setStyle(ButtonStyle.Danger)
501
+ .setEmoji("⚠️")
502
+ .setDisabled(true)
503
+ );
504
+
505
+ // 2 DISABLE BUTTONS
506
+ await interaction.update({
507
+ embeds: [interaction.message.embeds[0]],
508
+ components: [disabledRow]
509
+ });
510
+
511
+ // 3 CONFIRMATION
512
+ await interaction.followUp({
513
  content: "✅ **Dziękujemy!** Twoje potwierdzenie zostało pomyślnie zapisane.",
514
  flags: [MessageFlags.Ephemeral]
515
  });