function update

This commit is contained in:
Neko Life 2021-05-18 22:48:07 +00:00
parent 03d97d34fe
commit 316c87c5d5

View file

@ -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>`);