From a46de830fbbbf5d6cfb6c11dd9130276b73c576b Mon Sep 17 00:00:00 2001 From: JonnyBro Date: Mon, 17 Jan 2022 13:43:36 +0500 Subject: [PATCH] =?UTF-8?q?=D0=A4=D0=B8=D0=BA=D1=81=D1=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- commands/Owner/say.js | 43 +++++++++++++++++++++++-------------------- 1 file changed, 23 insertions(+), 20 deletions(-) diff --git a/commands/Owner/say.js b/commands/Owner/say.js index 23597886..3f471d80 100644 --- a/commands/Owner/say.js +++ b/commands/Owner/say.js @@ -17,7 +17,9 @@ class Say extends Command { } async run(message, args) { - if (!args[0]) return message.delete(); + if (!args[0]) { + if (message.deletable) return message.delete(); + } // Arguments split const split = "++"; @@ -27,8 +29,25 @@ class Say extends Command { let attachment = null; if (message.attachments.size > 0) attachment = message.attachments.first(); - if (args[1] && !args[2]) { - message.delete(); + if (!args[1] && !args[2]) { + if (message.deletable) message.delete(); + const saychannel = message.channel; + saychannel.sendTyping(); + + setTimeout(function () { + if (attachment) saychannel.send({ + content: args[0], + files: [{ + name: attachment.name, + attachment: attachment.url + }] + }); + 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(); @@ -45,26 +64,10 @@ class Say extends Command { }); }, 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(); - setTimeout(function () { - if (attachment) saychannel.send({ - content: args[0], - files: [{ - name: attachment.name, - attachment: attachment.url - }] - }); - else saychannel.send({ - content: args[0] - }); - }, 2000); - } else { - message.delete(); - const saychannel = message.channel; - saychannel.sendTyping(); - setTimeout(function () { if (attachment) saychannel.send({ content: args[0],