From ff256213529e09aecfdc4b7c8cbc1a48c5e2ff57 Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Fri, 28 Jan 2022 17:17:06 +0500 Subject: [PATCH] =?UTF-8?q?=D0=9C=D0=B5=D0=BB=D0=BA=D0=B8=D0=B5=20=D0=BF?= =?UTF-8?q?=D1=80=D0=B0=D0=B2=D0=BA=D0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Owner/say.js | 25 +++++++++++++------------ 1 file changed, 13 insertions(+), 12 deletions(-) diff --git a/commands/Owner/say.js b/commands/Owner/say.js index 3f471d80..2b43f819 100644 --- a/commands/Owner/say.js +++ b/commands/Owner/say.js @@ -27,56 +27,57 @@ class Say extends Command { for (let i = 0; i < args.length; i++) args[i] = args[i].trim(); let attachment = null; + let sayChannel = null; if (message.attachments.size > 0) attachment = message.attachments.first(); if (!args[1] && !args[2]) { if (message.deletable) message.delete(); - const saychannel = message.channel; - saychannel.sendTyping(); + sayChannel = message.channel; + sayChannel.sendTyping(); setTimeout(function () { - if (attachment) saychannel.send({ + if (attachment) sayChannel.send({ content: args[0], files: [{ name: attachment.name, attachment: attachment.url }] }); - else saychannel.send({ + else sayChannel.send({ content: args[0] }); }, 2000); } else if (args[1] && !args[2]) { if (message.deletable) message.delete(); - const saychannel = message.guild.channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]); - saychannel.sendTyping(); + sayChannel = message.guild.channels.cache.find(channel => channel.name.includes(args[1]) || channel.id === args[1]); + sayChannel.sendTyping(); setTimeout(function () { - if (attachment) saychannel.send({ + if (attachment) sayChannel.send({ content: args[0], files: [{ name: attachment.name, attachment: attachment.url }] }); - else saychannel.send({ + else sayChannel.send({ content: args[0] }); }, 2000); } else if (args[2]) { if (message.deletable) message.delete(); - const saychannel = this.client.guilds.cache.find(guild => guild.name == args[2] || guild.id == args[2]).channels.cache.find(channel => channel.name == args[1] || channel.id == args[1]); - saychannel.sendTyping(); + sayChannel = this.client.guilds.cache.find(guild => guild.name.includes(args[2]) || guild.id === args[2]).channels.cache.find(channel => channel.name.includes(args[1]) || channel.id === args[1]); + sayChannel.sendTyping(); setTimeout(function () { - if (attachment) saychannel.send({ + if (attachment) sayChannel.send({ content: args[0], files: [{ name: attachment.name, attachment: attachment.url }] }); - else saychannel.send({ + else sayChannel.send({ content: args[0] }); }, 2000);