mirror of
https://github.com/danbulant/Shasha
synced 2026-07-06 19:41:04 +00:00
cleanUps
This commit is contained in:
parent
ecec6b9652
commit
021990f393
1 changed files with 3 additions and 9 deletions
|
|
@ -1,18 +1,13 @@
|
||||||
'use strict';
|
'use strict';
|
||||||
|
|
||||||
const commando = require("@iceprod/discord.js-commando");
|
const commando = require("@iceprod/discord.js-commando");
|
||||||
const { trySend, findMemberRegEx, cleanMentionID, findChannelRegEx, findRoleRegEx, defaultImageEmbed, parseDoubleDash, parseComa, getRole, defaultEventLogEmbed, defaultDateFormat } = require("../../resources/functions");
|
const { trySend, parseDoubleDash, parseComa, defaultEventLogEmbed, defaultDateFormat } = require("../../resources/functions");
|
||||||
const { database } = require("../../database/mongo");
|
|
||||||
const col = database.collection("Guild");
|
|
||||||
const schedule = database.collection("Schedule");
|
|
||||||
const { scheduler } = require("../../resources/scheduler");
|
|
||||||
const { DateTime, Settings, Interval } = require("luxon");
|
const { DateTime, Settings, Interval } = require("luxon");
|
||||||
const muteSetting = require("./src/muteSetting");
|
const muteSetting = require("./src/muteSetting");
|
||||||
const fn = require("./src/duration");
|
const fn = require("./src/duration");
|
||||||
const durationFn = fn.duration;
|
const durationFn = fn.duration;
|
||||||
const targetUser = require("./src/targetUser");
|
const targetUser = require("./src/targetUser");
|
||||||
const configureMuteRole = require("./src/configureMuteRole");
|
const configureMuteRole = require("./src/configureMuteRole");
|
||||||
const { makeJSONMessage } = require("../../resources/debug");
|
|
||||||
const createInfraction = require("./src/createInfraction");
|
const createInfraction = require("./src/createInfraction");
|
||||||
Settings.defaultZone = "utc";
|
Settings.defaultZone = "utc";
|
||||||
|
|
||||||
|
|
@ -115,13 +110,12 @@ module.exports = class mute extends commando.Command {
|
||||||
} else return trySend(this.client, msg, "Args: `<[user_[mention|ID|name]]> -- [reason] -- [duration]`. Use `,` to provide multiple user. `--s` to view settings.\nExample:```js\n" + `${msg.guild.commandPrefix + this.name} 580703409934696449, @Shasha#1234, ur mom,#6969,^yuck\\s(ur)?\\s.{5}#\\d+69$--69y69mo69w420d420h420m420s -- Saying "joe"\`\`\``);
|
} else return trySend(this.client, msg, "Args: `<[user_[mention|ID|name]]> -- [reason] -- [duration]`. Use `,` to provide multiple user. `--s` to view settings.\nExample:```js\n" + `${msg.guild.commandPrefix + this.name} 580703409934696449, @Shasha#1234, ur mom,#6969,^yuck\\s(ur)?\\s.{5}#\\d+69$--69y69mo69w420d420h420m420s -- Saying "joe"\`\`\``);
|
||||||
|
|
||||||
if (targetUsers.length > 0) {
|
if (targetUsers.length > 0) {
|
||||||
let muted = [], cant = [], already = [], infractionN = [],
|
let muted = [], cant = [], already = [],
|
||||||
infractionToDoc = createInfraction(msg, targetUsers, "mute", reason);
|
infractionToDoc = createInfraction(msg, targetUsers, "mute", reason);
|
||||||
|
|
||||||
for (const EXEC of targetUsers) {
|
for (const EXEC of targetUsers) {
|
||||||
try {
|
try {
|
||||||
const RES = 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);
|
||||||
if (RES.infraction) infractionN.push(RES.infraction);
|
|
||||||
muted.push(EXEC.id);
|
muted.push(EXEC.id);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
if (/Missing Permissions|someone with higher position/.test(e.message)) cant.push(EXEC.id);
|
if (/Missing Permissions|someone with higher position/.test(e.message)) cant.push(EXEC.id);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue