Skip to content

Commit

Permalink
I hate myself
Browse files Browse the repository at this point in the history
  • Loading branch information
eYuM-coder committed Dec 26, 2024
1 parent 2229171 commit 5a259e8
Show file tree
Hide file tree
Showing 45 changed files with 1,696 additions and 1,004 deletions.
108 changes: 54 additions & 54 deletions src/assets/emojis.json
Original file line number Diff line number Diff line change
@@ -1,63 +1,63 @@
{
"image":"<:image_emoji:1293231582840356946>",
"currency":"<:currency_emoji:1293232058151338075>",
"image":"<:image_emoji:1321944957837246545>",
"currency":"<:currency_emoji:1321944905467301949>",

"games":"<:games_emoji:1293232229526540362>",
"admin":"<:admin_emoji:1293232336225439856>",
"configs":"<:configs_emoji:1293232729831378956>",
"utils":"<:utils_emoji:1293232854003879979>",
"success": "<:success:1293235164662595756>",
"games":"<:games_emoji:1321944820767264829>",
"admin":"<:admin_emoji:1321944716266307615>",
"configs":"<:configs_emoji:1321944621579767808>",
"utils":"<:utils_emoji:1321944362539548743>",
"success": "<:success:1321943892735819787>",

"green":"<:greensquare:1293233131016683593>",
"red":"<:redsquare:1293233250172538961>",
"green":"<:greensquare:1321945124951031828>",
"red":"<:redsquare:1321946893374197852>",

"dot": "<:purple_mee8_dot:1293234356982251611>",
"fail": "<:fail:1293235307998740480>",
"dot": "<:purple_mee8_dot:1321944244490997880>",
"fail": "<:fail:1321944093739188265>",

"misc": "<:speaker:1293235452861616159>",
"mod": "<:moderation_emoji:1293235825340842096>",
"misc": "<:speaker:1321947037796667493>",
"mod": "<:moderation_emoji:1321947173654495313>",

"pogger1": "<:poggerz:1293235961123045457>",
"heartbreak":"<:heartbreak:1293236055079649331>",
"pogger1": "<:poggerz:1321947254671671297>",
"heartbreak":"<:heartbreak:1321947324905427025>",

"lock": "<:lock:1293236154245709906>",
"unlock": "<:unlock:1293236281224073337>",

"owner": "<:owner:1293236377546391696>",

"discord_employee":"<:discordemployee:1293236507431272578>",
"discord_partner": "<:partnered:1293236593431285815>",
"bughunter_level_1": "<:bughunterl1:1293236694862135307>",
"bughunter_level_2": "<:bughunterl2:1293236864849018964>",
"hypesquad_events": "<:hypesquadevents:1293236985665687635>",
"house_brilliance": "<:brilliance:1293237074459365530>",
"house_bravery": "<:housebravery:1293237183469060187>",
"house_balance": "<:housebalance:1293237287408373813>",
"early_supporter": "<:earlysupporter:1293237683316854857>",
"verified_bot": "<:verifiedbot:1293237791219519531>",
"verified_developer": "<:verifieddev:1293237894890262588>",


"online": "<:online:1293237986359771257>",
"idle": "<:idle:1293238147441758359>",
"offline": "<:offline:1293238258230235269>",
"dnd": "<:donotdisturb:1293238425838682165>",
"verify":"<:success:1293235164662595756>",

"voice": "<:speaker:1293235452861616159>",

"pong": "<:online:1293237986359771257>",

"altdetector":"<:alt:1293238819151151195>",
"applications":"<:form:1293239246525825106>",
"config":"<:configs_emoji:1293232729831378956>",
"utility":"<:utils_emoji:1293232854003879979>",
"economy":"<:currency_emoji:1293232058151338075>",
"fun":"<:fun_emoji:1293239531629318274>",
"images":"<:image_emoji:1293231582840356946>",
"information":"<:information_emoji:1293239890934497292>",
"moderation":"<:moderation_emoji:1293235825340842096>",
"reactionrole":"<:reaction_roles:1293239986866360411>",
"tickets":"<:ticket_emoji:1293240103099170918>"
"lock": "<:lock:1321947386020626516>",
"unlock": "<:unlock:1321947425472118858>",

"owner": "<:owner:1321947536252207126>",

"discord_employee":"<:discordemployee:1321947625561260165>",
"discord_partner": "<:partnered:1321947730871980127>",
"bughunter_level_1": "<:bughunterl1:1321947799712956499>",
"bughunter_level_2": "<:bughunterl2:1321947853844648120>",
"hypesquad_events": "<:hypesquadevents:1321947941375836171>",
"house_brilliance": "<:brilliance:1321948038918443029>",
"house_bravery": "<:housebravery:1321948087886811156>",
"house_balance": "<:housebalance:1321948171265380392>",
"early_supporter": "<:earlysupporter:1321948328208109693>",
"verified_bot": "<:verifiedbot:1321948602179780721>",
"verified_developer": "<:verifieddev:1321948646245269564>",


"online": "<:online:1321948803426685061>",
"idle": "<:idle:1321948844065558530>",
"offline": "<:offline:1321948929428033687>",
"dnd": "<:donotdisturb:1321948981038813194>",
"verify":"<:success:1321943892735819787>",

"voice": "<:speaker:1321947037796667493>",

"pong": "<:online:1321948803426685061>",

"altdetector":"<:alt:1321949179978711040>",
"applications":"<:form:1321949263059615925>",
"config":"<:configs_emoji:1321944621579767808>",
"utility":"<:utils_emoji:1321944362539548743>",
"economy":"<:currency_emoji:1321944905467301949>",
"fun":"<:fun_emoji:1321949458837143643>",
"images":"<:image_emoji:1321944957837246545>",
"information":"<:information_emoji:1321949669604986921>",
"moderation":"<:moderation_emoji:1321947173654495313>",
"reactionrole":"<:reaction_roles:1321949811410342013>",
"tickets":"<:ticket_emoji:1321949897934635114>"

}
2 changes: 1 addition & 1 deletion src/commands/config/customcommandlist.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ module.exports = class extends Command {
constructor(...args) {
super(...args, {
name: "customcommands",
aliases: ["cclist", "customcommandlist", "ccmds", "customcmds", "ccs"],
description: "Gives a list of custom commands",
category: "Config",
aliases: ["ccs"],
cooldown: 5,
});
}
Expand Down
2 changes: 1 addition & 1 deletion src/commands/fun/calculator.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ module.exports = class CalculatorCommand extends Command {
embed: {
title: 'Calculator ',
color: '#5865F2',
footer: 'Pogy.xyz',
footer: 'mee8.net',
timestamp: true,
},
disabledQuery: 'Calculator is disabled!',
Expand Down
6 changes: 3 additions & 3 deletions src/commands/moderation/clear.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ module.exports = class extends Command {
super(...args, {
name: "clear",
aliases: ["cls", "purge"],
description: "Delete the specified amount of messages (limit: 1000)",
description: "Delete the specified amount of messages (limit: 10000)",
category: "Moderation",
usage: "purge <message-count> [reason]",
examples: ["purge 20", "cls 50", "clear 125"],
Expand All @@ -34,7 +34,7 @@ module.exports = class extends Command {
}

const amount = parseInt(args[0]);
if (isNaN(amount) === true || !amount || amount < 0 || amount > 1000) {
if (isNaN(amount) === true || !amount || amount < 0 || amount > 10000) {
return message.channel.sendCustom({
embeds: [
new MessageEmbed()
Expand All @@ -43,7 +43,7 @@ module.exports = class extends Command {
message.author.displayAvatarURL({ dynamic: true })
)
.setTitle(`${fail} Clear Error`)
.setDescription(`I can only purge between 1 - 1000 messages.`)
.setDescription(`I can only purge between 1 - 10000 messages.`)
.setTimestamp()
.setFooter({ text: `${process.env.AUTH_DOMAIN}` })
.setColor(message.guild.me.displayHexColor),
Expand Down
3 changes: 2 additions & 1 deletion src/commands/moderation/createrole.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,8 @@ module.exports = class CreateRoleCommand extends Command {
cooldown: 5,
usage: '"<roleName>" <color> [hoist] [mentionable] [position]',
guildOnly: true,
permissions: ["MANAGE_ROLES"],
userPermission: ["MANAGE_ROLES"],
botPermission: ["MANAGE_ROLES"],
});
}

Expand Down
4 changes: 2 additions & 2 deletions src/commands/moderation/findmessage.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ module.exports = class FindMessagesCommand extends Command {
description: "Find messages from a user containing a keyword in a given time range",
category: "Moderation", // Adjust the category as needed
cooldown: 5,
usage: "/findmessages <@user> <keyword> <time>",
permissions: ["MANAGE_MESSAGES"], // Add any required permissions
usage: "findmessages <@user> <keyword> <time>",
userPermission: ["MANAGE_MESSAGES"], // Add any required permissions
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/commands/moderation/mute.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ module.exports = class extends Command {
description: "",
category: "Moderation",
cooldown: 5,
userPermission: ["MODERATE_MEMBERS"],
botPermission: ["MODERATE_MEMBERS"],
});
}
async run(message, args) {
Expand Down
1 change: 0 additions & 1 deletion src/commands/moderation/removewarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = class extends Command {
usage: "<user> [ID]",
examples: ["rw @peter iasdjas"],
guildOnly: true,
userPermission: ["MANAGE_ROLES"],
});
}

Expand Down
1 change: 0 additions & 1 deletion src/commands/moderation/resetwarn.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ module.exports = class extends Command {
usage: "<user> [reason]",
examples: ["resetwarns @Peter Warnings have been reset"],
guildOnly: true,
userPermission: ["MANAGE_ROLES"],
});
}

Expand Down
2 changes: 2 additions & 0 deletions src/commands/moderation/unmute.js
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ module.exports = class extends Command {
description: "",
category: "Moderation",
cooldown: 5,
userPermission: ["MODERATE_MEMBERS"],
botPermission: ["MODERATE_MEMBERS"],
});
}
async run(message, args) {
Expand Down
49 changes: 7 additions & 42 deletions src/commands/moderation/warn.js
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ module.exports = class extends Command {
usage: "<user> [time] [reason]",
examples: ["warn @user Please do not swear."],
guildOnly: true,
userPermission: ["KICK_MEMBERS"],
});
}

Expand Down Expand Up @@ -55,51 +54,17 @@ module.exports = class extends Command {
}

// Combine all arguments after the mention into one string
const fullCommand = args.slice(1).join(" ");
const input = fullCommand;
const regex = /"([^"]+)"|(\d+\s*[a-z]+)|(\S+)/g;

let match;
const parts = [];

while ((match = regex.exec(input)) !== null) {
// match[1] is for quoted strings
// match[2] is for time durations (e.g., "2d", "6h")
// match[3] is for any other non-whitespace part
if (match[1]) {
parts.push({ type: "quoted", value: match[1] });
} else if (match[2]) {
parts.push({ type: "time", value: match[2] });
} else if (match[3]) {
parts.push({ type: "other", value: match[3] });
}
}

console.log(parts);
const allArgs = args.slice(1).join(" ");

let parsedArgs = null;
try {
parsedArgs = parts.map((arg) => arg.replace(/^"|"$/g, ""));
} catch (e) {
// do nothing
}
let time = 0;
try {
time = ms(parsedArgs[0]);
} catch (e) {
time = ms("1d");
}
const timeRegex = /\d+\s*[a-z]+/g;

// If there are time parts, parse them; otherwise, set time to null (infinite)
let formattedTime = time ? await usePrettyMs(time) : "Infinity";
const timeMatches = allArgs.match(timeRegex).join(" ");

// Remove the parsed time from the reason
let reason =
parsedArgs !== undefined
? args.slice(match !== undefined ? 1 : 0).join(" ")
: parsedArgs.slices(match !== undefined ? 1 : 0).join(" ");
let time = timeMatches ? ms(timeMatches) : ms("6h");
let formattedTime = await usePrettyMs(time);

reason = reason || "Not Specified"; // Default reason if none provided
let reason = allArgs.replace(timeMatches ? timeMatches : "", "").trim();
reason = reason || "No Reason Specified";

let warnID = random.password({
length: 16,
Expand Down
1 change: 0 additions & 1 deletion src/commands/moderation/warnings.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ module.exports = class extends Command {
examples: ["warnings @Peter"],
guildOnly: true,
botPermission: ["ADD_REACTIONS"],
userPermissions: ["KICK_MEMBERS"],
});
}

Expand Down
5 changes: 1 addition & 4 deletions src/commands/moderation/warnpurge.js
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,9 @@ module.exports = class extends Command {
examples: ["warnpurge @Peter_ 10"],
guildOnly: true,
botPermission: [
"SEND_MESSAGES",
"EMBED_LINKS",
"KICK_MEMBERS",
"MANAGE_MESSAGES",
],
userPermission: ["KICK_MEMBERS", "MANAGE_MESSAGES"],
userPermission: ["MANAGE_MESSAGES"],
});
}

Expand Down
33 changes: 27 additions & 6 deletions src/commands/owner/restart.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
const Command = require("../../structures/Command");
const { exec } = require("child_process");

module.exports = class extends Command {
constructor(...args) {
Expand All @@ -13,14 +14,34 @@ module.exports = class extends Command {
async run(message) {
if (
!message.client.config.owner.includes(message.author.id) &&
message.client.config.developers.includes(message.author.id)
(!message.client.config.developers.includes(message.author.id) ||
message.client.config.developers.includes(message.author.id))
) {
return message.channel.sendCustom(`This command is for the owner.`);
} else {
await message.channel
.sendCustom("Restarting!")
.catch((err) => this.client.console.error(err));
process.exit(1);
}

try {
await message.channel.sendCustom("Deploying and restarting...");

exec("mee8 deploy", (error, stdout) => {
const response = error || stdout;
console.log(response);

if (error) {
message.channel.sendCustom(
`Deployment failed:\n\`\`\`${error.message}\`\`\``
);
} else {
message.channel.sendCustom(
`Deployment successful:\n\`\`\`${response}\`\`\``
);
// Terminate the bot after deployment
process.exit(0);
}
});
} catch (err) {
this.client.console.error(err);
message.channel.sendCustom(`An error occurred: \`${err.message}\``);
}
}
};
2 changes: 1 addition & 1 deletion src/commands/utility/embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ module.exports = class extends Command {
.awaitMessages({
filter: (m) => m.author.id === message.author.id,
max: 1,
time: 30000,
time: 180000,
})
.then((collected) => {
if (
Expand Down
Loading

0 comments on commit 5a259e8

Please sign in to comment.