From 83e344487f55216a5670827086abb88087f5e300 Mon Sep 17 00:00:00 2001 From: Histmy Date: Fri, 3 Feb 2023 20:38:17 +0100 Subject: [PATCH] =?UTF-8?q?decentn=C3=AD=20fix=20ksd?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/app.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/app.ts b/src/app.ts index f35c761..b8b9dbe 100644 --- a/src/app.ts +++ b/src/app.ts @@ -236,7 +236,7 @@ async function runKomand(mes: Message, cmd: Komand, cmdName: string, arg: string } client.on("messageCreate", async mes => { - if (process.env.ignoreMess) return; + if (process.env.ignoreMess || mes.author.id == client.user!.id) return; const [mesPrefix, komandSDiakritikou, ...args] = mes.content.split(" "); if (oddiakritikovat(mesPrefix.toLowerCase()) != prefix) return void runEvent("messageCreate", [mes]); @@ -281,6 +281,9 @@ client.on("messageCreate", async mes => { const cmd = client.komandy[cmdName]; radek.components.forEach(btn => btn.setDisabled()); i.update({ content: `ok vole ${emouty.d3k}`, components: [radek] }); + + if (mes.channel.type == ChannelType.DM && cmd?.DMUnsafe) return void mes.channel.send("tuten komand bohuzel v sz nefunkuje"); + runKomand(mes, cmd, cmdName, celArgs); }); collector.on("end", c => {