From 316c87c5d5ed78f4ae71b83faa03775217e665ab Mon Sep 17 00:00:00 2001 From: Neko Life Date: Tue, 18 May 2021 22:48:07 +0000 Subject: [PATCH] function update --- cmds/utility/send.js | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/cmds/utility/send.js b/cmds/utility/send.js index f96dc5a..f3f49b4 100644 --- a/cmds/utility/send.js +++ b/cmds/utility/send.js @@ -19,15 +19,20 @@ module.exports = class send extends commando.Command { return trySend(this.client, msg, 'Where?!?'); } const search = cleanMentionID(comarg[0]), - channel = findChannelRegEx(msg, search)[0], sendTheMes = args.slice(comarg[0].length).trim(); + let channel; + if (/^\d{17,19}$/.test(search)) { + channel = msg.guild.channels.cache.get(search); + } if (!channel) { - return trySend(this.client, msg, "That channel is like your gf. Doesn't exist <:cathmmLife:772716381874946068>"); - } else { - if (!channel.permissionsFor(msg.author).has("SEND_MESSAGES")) { - return trySend(this.client, msg, "No <:cathmmLife:772716381874946068>"); + channel = findChannelRegEx(msg, search, ["category", "voice"])[0]; + if (!channel) { + return trySend(this.client, msg, "That channel is like your gf. Doesn't exist <:cathmmLife:772716381874946068>"); } } + if (!channel.permissionsFor(msg.author).has("SEND_MESSAGES")) { + return trySend(this.client, msg, "No <:cathmmLife:772716381874946068>"); + } try { if (sendTheMes.length === 0) { return trySend(this.client, channel, `<@!${msg.author.id}> If you wanna send nothin then why you even typed that <:bruhLife:798789686242967554>`);