fix notif message

This commit is contained in:
Neko-Life 2021-08-09 19:33:48 +07:00
parent a0082ee4cf
commit dd51b3df13
2 changed files with 15 additions and 6 deletions

View file

@ -45,7 +45,8 @@ module.exports = class ban extends commando.Command {
if (ARG === "--" || ARG.trim().length < 1) continue;
if (ARG.startsWith("d ")) {
const U = ARG.slice(2).trim();
if (U.length && !/\D/.test(U)) daysToDeleteMessages = parseInt(U, 10); else return trySend(msg.client, msg, "Invalid number of days to delete messages!");
if (U.length && !/\D/.test(U)) daysToDeleteMessages = parseInt(U, 10); else return trySend(msg.client,
msg, "Invalid number of days to delete messages!");
continue;
}
else if (CHECK_FOR_DURATION_REGEXP.test(ARG.trim()))
@ -93,7 +94,8 @@ module.exports = class ban extends commando.Command {
bannedStr = bannedStr.slice(0, -2);
if (bannedArr.length) bannedStr += ` and ${bannedArr.length} more...`;
if (already.length) emb.addField("Already banned", "<@" + already.join(">, <@") + ">\n\nDuration updated for these users");
if (already.length) emb.addField("Already banned", "<@" + already.join(">, <@") +
">\n\nDuration updated for these users");
emb.addField("Banned", bannedStr || "`[NONE]`")
.addField("At", defaultDateFormat(pDuration.invoked), true)
@ -101,7 +103,8 @@ module.exports = class ban extends commando.Command {
}
emb.addField("For", pDuration.duration?.strings.join(" ") || "Indefinite");
if (cant.length) emb.addField("Can't ban", "<@" + cant.join(">, <@") + ">\n\n**You can't ban someone with higher position than you <:nekokekLife:852865942530949160>**")
if (cant.length) emb.addField("Can't ban", "<@" + cant.join(">, <@") +
">\n\n**You can't ban someone with the same or higher position than you <:nekokekLife:852865942530949160>**");
return trySend(msg.client, msg, { content: resultMsg, embed: emb });
}

View file

@ -120,7 +120,11 @@ module.exports = class mute extends commando.Command {
for (const EXEC of targetUsers) {
try {
await EXEC.mute(msg.guild, { duration: duration, infraction: infractionToDoc.infraction, moderator: msg.member }, reason);
await EXEC.mute(msg.guild, {
duration: duration,
infraction: infractionToDoc.infraction,
moderator: msg.member
}, reason);
muted.push(EXEC.id);
} catch (e) {
if (/Missing Permissions|someone with higher position/.test(e.message)) cant.push(EXEC.id);
@ -146,7 +150,8 @@ module.exports = class mute extends commando.Command {
mutedStr = mutedStr.slice(0, -2);
if (mutedArr.length) mutedStr += ` and ${mutedArr.length} more...`;
if (already.length) emb.addField("Already muted", "<@" + already.join(">, <@") + ">\n\nDuration updated for these users");
if (already.length) emb.addField("Already muted", "<@" + already.join(">, <@") +
">\n\nDuration updated for these users");
emb.addField("Muted", mutedStr || "`[NONE]`")
.addField("At", defaultDateFormat(duration.invoked), true)
@ -154,7 +159,8 @@ module.exports = class mute extends commando.Command {
}
emb.addField("For", duration.duration?.strings.join(" ") || "Indefinite");
if (cant.length) emb.addField("Can't mute", "<@" + cant.join(">, <@") + ">\n\n**You can't mute someone with higher position than you <:nekokekLife:852865942530949160>**");
if (cant.length) emb.addField("Can't mute", "<@" + cant.join(">, <@") +
">\n\n**You can't mute someone with the same or higher position than you <:nekokekLife:852865942530949160>**");
return trySend(msg.client, msg, { content: resultMsg, embed: emb });
}