From 41f3b94ed3918c5a8fe9ebaa806a1789c6dc9d95 Mon Sep 17 00:00:00 2001 From: Histmy Date: Thu, 27 Jun 2024 16:07:25 +0200 Subject: [PATCH] Highlight of selected command suggestion --- package-lock.json | 4 ++-- package.json | 2 +- src/app.ts | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/package-lock.json b/package-lock.json index 13fa35d..c4a984e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,12 +1,12 @@ { "name": "denim_3001", - "version": "3001.58.5", + "version": "3001.58.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "denim_3001", - "version": "3001.58.5", + "version": "3001.58.6", "license": "ISC", "dependencies": { "@discordjs/voice": "^0.17.0", diff --git a/package.json b/package.json index 7e9a4cf..e980c8f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "denim_3001", - "version": "3001.58.5", + "version": "3001.58.6", "description": "Toto je velmi kvalitní bot.", "repository": { "url": "https://github.com/Histmy/Denim-Bot/" diff --git a/src/app.ts b/src/app.ts index 076db6d..d0ecaaf 100644 --- a/src/app.ts +++ b/src/app.ts @@ -1,4 +1,4 @@ -import { ChannelType, Client, CommandInteraction, GatewayIntentBits, InteractionReplyOptions, Message, Partials } from "discord.js"; +import { ButtonStyle, ChannelType, Client, CommandInteraction, GatewayIntentBits, InteractionReplyOptions, Message, Partials } from "discord.js"; import { readdirSync } from "fs"; import { CUser, KomandNaExport, Komand, ListenerFunkce, Modul, SRecord, SuperListenerFunkce, CClient, HelpServer, KomandRaw } from "./utils/types"; import { adminLog, formatCas, oddiakritikovat, log, rand, prefix, nabidni } from "./utils/utils.js"; @@ -321,7 +321,7 @@ client.on("messageCreate", async mes => { const komand = nabidka[lookupId]; const cmdName = client.aliasy[komand] ?? komand; const cmd = client.komandy[cmdName]; - radek.components.forEach(btn => btn.setDisabled()); + radek.components.forEach((btn, i) => btn.setDisabled() && (i == lookupId && btn.setStyle(ButtonStyle.Primary))); i.update({ content: `ok vole ${emouty.d3k}`, components: [radek] }); if (!cmd) return void mes.channel.send("bohuzel negdo sy ze mi dela prel");