From 5ee0774eebc94337c1a2984144978ed427d22ad9 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Sun, 12 Feb 2023 16:00:53 +0500 Subject: [PATCH] =?UTF-8?q?=D1=83=D0=BF=D1=81=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Owner/announcement.js | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/commands/Owner/announcement.js b/commands/Owner/announcement.js index 62f5b60a..ede4d1b7 100644 --- a/commands/Owner/announcement.js +++ b/commands/Owner/announcement.js @@ -59,15 +59,9 @@ class Announcement extends BaseCommand { if (guild.id === "568120814776614924") return; guild = await guild.fetch(); - const channel = guild.channels.cache.get(guild?.data.plugins.news); - if (!channel && !important) return; + const channel = important ? (guild?.data?.plugins.news ? guild.channels.cache.get(guild?.data?.plugins.news) : guild.channels.cache.find(c => c.isTextBased())) : guild.channels.cache.get(guild?.data?.plugins.news); - if (!channel && important) { - guild.channels.cache.find(c => c.isTextBased()).send({ - content: `${interaction.options.getBoolean("tag") ? "||@everyone|| " : ""}ВАЖНОЕ ОБЪЯВЛЕНИЕ!`, - embeds: [embed], - }); - } else if (channel) channel.send({ + channel.send({ content: `${interaction.options.getBoolean("tag") ? "||@everyone|| " : ""}ВАЖНОЕ ОБЪЯВЛЕНИЕ!`, embeds: [embed], });