commit 3a2e52d660137a73256727eea3ac3af90a2917ac
parent 2f394a83bab1969485608c024804371e75884feb
Author: NK <[email protected]>
Date: Thu, 6 Apr 2023 13:32:44 +0100
the great revamp 2.0
Diffstat:
7 files changed, 2 insertions(+), 137 deletions(-)
diff --git a/command/Config/settings.js b/command/Config/settings.js
@@ -7,20 +7,6 @@ module.exports = {
category: "Config",
options: [
{
- type: 1,
- name: "prefix",
- description: "Configure prefix settings for the server",
- options: [
- {
- type: 3,
- name: "prefix",
- description: "The prefix for the server",
- required: true,
- choices: [],
- },
- ],
- },
- {
type: 2,
name: "enable",
description: "Enable commands/category for the server",
@@ -167,10 +153,7 @@ module.exports = {
},
],
run: async (client, interaction, args, utils, data) => {
- if (args[0].toLowerCase() === "prefix") {
- await client.data.setPrefix(interaction.guild.id, args[1]);
- interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
- } else if (args[0].toLowerCase() === "tips") {
+ if (args[0].toLowerCase() === "tips") {
if (args[1]) {
await client.data.setTips(interaction.guild.id, "true");
interaction.followUp({
diff --git a/command/Information/help.js b/command/Information/help.js
@@ -157,23 +157,6 @@ module.exports = {
} else {
UserPermissions = [command.UserPerms ? command.UserPerms : ""];
}
- if (command.BotPerms && Array.isArray(command.BotPerms)) {
- BotPermissions = command.BotPerms;
- } else {
- BotPermissions = [command.BotPerms ? command.BotPerms : ""];
- }
- const BotPerms = BotPermissions.map(x =>
- x
- .split("_")
- .map(y => y[0] + y.substring(1, y.length).toLowerCase())
- .join(" ")
- ).join(", ");
- const UserPerms = UserPermissions.map(x =>
- x
- .split("_")
- .map(y => y[0] + y.substring(1, y.length).toLowerCase())
- .join(" ")
- ).join(", ");
const fields = [];
const embed = new EmbedBuilder()
.setTitle(`"${command.name}" command details`)
@@ -205,18 +188,6 @@ module.exports = {
name: "**Cooldown**:",
value: utils.timer(command.timeout),
});
-
- if (command.UserPerms)
- fields.push({
- name: "**Required User Permission**:",
- value: UserPerms,
- });
-
- if (command.BotPerms)
- fields.push({
- name: "**Required Bot Permission**:",
- value: BotPerms,
- });
embed
.setFooter({
text: `Requested by ${interaction.user.tag}`,
diff --git a/events/interactionCreate.js b/events/interactionCreate.js
@@ -70,17 +70,6 @@ client.on("interactionCreate", async interaction => {
],
});
}
-
- // if (!interaction.guild.me.permissions.has(cmd.BotPerms || [])) {
- // return interaction.followUp({
- // content: `You can't use this command. I need to have ${cmd.BotPerms} permission to use this command.`,
- // });
- // }
- // if (!interaction.member.permissions.has(cmd.UserPerms || [])) {
- // return interaction.followUp({
- // content: `You can't use this command. I need to have ${cmd.UserPerms} permission to use this command.`,
- // });
- // }
if (data.Guild?.Category) {
if (data.Guild.Category.includes(cmd.directory)) {
return interaction.followUp({
@@ -116,7 +105,6 @@ client.on("interactionCreate", async interaction => {
cmd
.run(client, interaction, args, utils, data)
.catch(e => sendE(e, interaction));
- // client.addcmdsused(interaction.user.id);
client.channels.cache.get(client.config.CMDLog).send({
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
});
@@ -129,7 +117,6 @@ client.on("interactionCreate", async interaction => {
client.channels.cache.get(client.config.CMDLog).send({
content: `\`${interaction.user.tag}(${interaction.user.id})\`\n has used \n**${cmd.name}**\n command in \n\`${interaction.guild.name}(${interaction.guild.id})\``,
});
- // client.addcmdsused(interaction.user.id);
new cooldown({
User: interaction.user.id,
CMD: cmd.name,
diff --git a/events/messageCreate.js b/events/messageCreate.js
@@ -11,7 +11,6 @@ client.on("messageCreate", async message => {
if (!userDB) return;
data.Guild = guildDB;
data.User = userDB;
- console.log(message.content);
if (!guildDB) await client.data.CreateGuild(message.guild.id);
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
const _ = new EmbedBuilder()
diff --git a/models/bot.js b/models/bot.js
@@ -1,23 +0,0 @@
-const mongoose = require("mongoose");
-module.exports = mongoose.model(
- "status",
- new mongoose.Schema({
- Bot: {
- type: String,
- default: "null",
- },
- Status: { type: String, default: "false" },
- Guilds: {
- type: String,
- default: "null",
- },
- Users: {
- type: String,
- default: "null",
- },
- Commands: {
- type: Array,
- default: [],
- },
- })
-);
diff --git a/util/functions/function.js b/util/functions/function.js
@@ -213,7 +213,7 @@ function cooldown(dbtime, defaults, msg) {
return msg.followUp({
embeds: [
new EmbedBuilder()
- .setColor("RANDOM")
+ .setColor("Random")
.setTimestamp()
.setTitle(slowed)
.setDescription(
diff --git a/util/functions/mongoose.js b/util/functions/mongoose.js
@@ -6,7 +6,6 @@ const cachegoose = new GooseCache(mongoose, {
mongoose.set("useFindAndModify", false);
const u = require("../../models/users");
const g = require("../../models/guilds");
-const m = require("../../models/bot");
module.exports = {
/**
* @param {String} URI - Mongo Connection URI
@@ -63,34 +62,28 @@ module.exports = {
const ss = new u({ User: ID });
const {
User,
- AFKDate,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
- CommandUsed,
} = ss;
await ss.save().catch(error => console.log(error));
return {
User,
- AFKDate,
Tier,
Premium,
Blacklist,
Blacklist_Reason,
PremiumServers,
- CommandUsed,
};
} else {
const User = user.User;
- const AFKDate = user.AFKDate;
const Tier = user.Tier;
const Premium = user.Premium;
const Blacklist = user.Blacklist;
const Blacklist_Reason = user.Blacklist_Reason;
const PremiumServers = user.PremiumServers;
- const CommandUsed = user.CommandUsed;
return {
User,
AFKDate,
@@ -99,7 +92,6 @@ module.exports = {
Blacklist,
Blacklist_Reason,
PremiumServers,
- CommandUsed,
};
}
},
@@ -195,24 +187,6 @@ module.exports = {
return;
},
/**
- * @param {String} ID - User ID
- * @param {String} Prefix - Guild Prefix
- */
- async setPrefix(ID, Prefix) {
- if (!ID) throw new Error("Guild ID?");
- if (!Prefix) throw new Error("Prefix?");
- const guild = await g.findOne({ Guild: ID });
- if (!guild) {
- const newU = new g({ Guild: ID });
- await newU.save().catch(error => console.log(error));
- return { Prefix };
- }
- guild.Prefix = Prefix;
- await guild.save().catch(error => console.log(error));
- cachegoose.clearCache();
- return { Prefix };
- },
- /**
* @param {String} ID - Guild ID
* @param {String} Toggle - premium Toggle
*/
@@ -323,32 +297,6 @@ module.exports = {
return true;
},
/**
- * @param {String} ID - Bot ID
- * @param {String} Toggle - Maintenance Toggle
- */
- async maintenance(ID, Toggle) {
- if (!ID) throw new Error("Please Provide a ID!");
- if (!Toggle) throw new Error("Please Provide a Toggle!");
- const idk = await m.findOne({ Bot: ID });
- if (!idk) {
- const newdb = new m({ Bot: ID });
- if (Toggle === "true") {
- newdb.Status = "true";
- } else {
- newdb.Status = "false";
- }
- await newdb.save().catch(error => console.log(error));
- return;
- } else if (Toggle === "true") {
- idk.Status = "true";
- } else {
- idk.Status = "false";
- }
- await idk.save().catch(error => console.log(error));
- cachegoose.clearCache();
- return;
- },
- /**
* @param {String} ID - Guild ID
* @param {String} Toggle - Level Toggle
*/