the great revamp

This commit is contained in:
NK 2023-04-06 13:23:31 +01:00
parent 4001080638
commit 2f394a83ba
11 changed files with 82 additions and 525 deletions

View file

@ -192,7 +192,7 @@ module.exports = {
}) })
.setTimestamp() .setTimestamp()
.setTitle(d.perk) .setTitle(d.perk)
.addField("Effects", d.effects); .addFields({ name: "Effects", value: d.effects });
interaction.followUp({ embeds: [embed] }); interaction.followUp({ embeds: [embed] });
}, },
}; };

View file

@ -16,9 +16,11 @@ module.exports = {
try { try {
const user = await client.data.getUser(interaction.user.id); const user = await client.data.getUser(interaction.user.id);
const guild = await client.data.getGuild(interaction.guild.id); const guild = await client.data.getGuild(interaction.guild.id);
if (interaction.options.getBoolean("choice") == true) { if (interaction.options.getBoolean("choice")) {
if (guild.Premium == true) { if (guild.Premium) {
interaction.followUp({ content: "This server is already premium" }); return interaction.followUp({
content: "This server is already premium",
});
} }
if ( if (
(user.Tier == 1 && user.PremiumServers.length >= 5) || (user.Tier == 1 && user.PremiumServers.length >= 5) ||
@ -46,22 +48,22 @@ module.exports = {
.setFooter({ text: "Thank you for supporting Cath!" }) .setFooter({ text: "Thank you for supporting Cath!" })
.setColor("Green") .setColor("Green")
.setTimestamp() .setTimestamp()
.setAuthor( .setAuthor({
interaction.user.tag, name: interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
), }),
], ],
}); });
client.channels.cache.get(client.config.ServerLog).send({ client.channels.cache.get(client.config.ServerLog).send({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setTitle("New Premium Server") .setTitle("New Premium Server")
.addField( .addFields({
"Server Info", name: "Server Info",
`**>Server Name**: \n${interaction.guild.name} value: `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id} **>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}` **>Server Member Count**: \n${interaction.guild.memberCount}`,
) })
.setTimestamp() .setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true })) .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Green"), .setColor("Green"),
@ -69,11 +71,13 @@ module.exports = {
}); });
} }
} else { } else {
if (guild.Premium == false) { if (!guild.Premium) {
interaction.followUp({ content: "This server isn't premium yet" }); return interaction.followUp({
content: "This server isn't premium yet",
});
} }
if (!user.PremiumServers.includes(interaction.guild.id)) { if (!user.PremiumServers.includes(interaction.guild.id)) {
interaction.followUp({ return interaction.followUp({
content: content:
"You can't remove due to you aren't the person who made the server premium", "You can't remove due to you aren't the person who made the server premium",
}); });
@ -93,22 +97,22 @@ module.exports = {
) )
.setColor("Red") .setColor("Red")
.setTimestamp() .setTimestamp()
.setAuthor( .setAuthor({
interaction.user.tag, name: interaction.user.tag,
interaction.user.displayAvatarURL({ dynamic: true }) iconURL: interaction.user.displayAvatarURL({ dynamic: true }),
), }),
], ],
}); });
client.channels.cache.get(client.config.ServerLog).send({ client.channels.cache.get(client.config.ServerLog).send({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
.setTitle("Premium Server Removed") .setTitle("Premium Server Removed")
.addField( .addFields({
"Server Info", name: "Server Info",
`**>Server Name**: \n${interaction.guild.name} value: `**>Server Name**: \n${interaction.guild.name}
**>Server ID**: \n${interaction.guild.id} **>Server ID**: \n${interaction.guild.id}
**>Server Member Count**: \n${interaction.guild.memberCount}` **>Server Member Count**: \n${interaction.guild.memberCount}`,
) })
.setTimestamp() .setTimestamp()
.setThumbnail(interaction.guild.iconURL({ dynamic: true })) .setThumbnail(interaction.guild.iconURL({ dynamic: true }))
.setColor("Red"), .setColor("Red"),

View file

@ -20,48 +20,6 @@ module.exports = {
}, },
], ],
}, },
{
type: 1,
name: "welcome",
description: "Configure welcome channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for welcome messages",
required: true,
channelTypes: [0],
},
],
},
{
type: 1,
name: "goodbye",
description: "Configure goodbye channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for goodbye messages",
required: true,
channelTypes: [0],
},
],
},
{
type: 1,
name: "log",
description: "Configure log channel settings for the server",
options: [
{
type: 7,
name: "channel",
description: "The channel for log messages",
required: true,
channelTypes: [0],
},
],
},
{ {
type: 2, type: 2,
name: "enable", name: "enable",
@ -212,51 +170,6 @@ module.exports = {
if (args[0].toLowerCase() === "prefix") { if (args[0].toLowerCase() === "prefix") {
await client.data.setPrefix(interaction.guild.id, args[1]); await client.data.setPrefix(interaction.guild.id, args[1]);
interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` }); interaction.followUp({ content: `Saved \`${args[2]}\` as the prefix` });
} else if (args[0].toLowerCase() === "welcome") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setWelcome(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the welcome channel`,
});
}
} else if (args[0].toLowerCase() === "goodbye") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
await client.data.setGoodbye(interaction.guild.id, args[1]);
interaction.followUp({
content: `Saved **${channel}** as the goodbye channel`,
});
}
} else if (args[0].toLowerCase() === "log") {
const channel = interaction.guild.channels.cache.get(args[1]);
if (channel.type !== "GUILD_TEXT") {
interaction.followUp({ content: "Please provide a text channel" });
} else {
let webhookid;
let webhooktoken;
await channel
.createWebhook(interaction.guild.name, {
avatar: interaction.guild.iconURL({ format: "png" }),
})
.then(webhook => {
webhookid = webhook.id;
webhooktoken = webhook.token;
});
await client.data.setLog(
interaction.guild.id,
channel.id,
webhookid,
webhooktoken
);
interaction.followUp({
content: `Saved **${channel}** as the log channel`,
});
}
} else if (args[0].toLowerCase() === "tips") { } else if (args[0].toLowerCase() === "tips") {
if (args[1]) { if (args[1]) {
await client.data.setTips(interaction.guild.id, "true"); await client.data.setTips(interaction.guild.id, "true");
@ -350,21 +263,6 @@ module.exports = {
} else { } else {
const d = ` const d = `
**Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."} **Prefix**: ${data.Guild.Prefix ? data.Guild.Prefix : "C."}
**Welcome Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Welcome)
? interaction.guild.channels.cache.get(data.Guild.Welcome)
: "None"
}
**Goodbye Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Goodbye)
? interaction.guild.channels.cache.get(data.Guild.Goodbye)
: "None"
}
**Log Channel**: ${
interaction.guild.channels.cache.get(data.Guild.Log)
? interaction.guild.channels.cache.get(data.Guild.Log)
: "None"
}
**Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"} **Tips**: ${data.Guild.Tips ? "Enable" : "Disabled"}
**Disabled Commands**: ${ **Disabled Commands**: ${
data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None" data.Guild.Commands.length ? data.Guilds.Commands.join(",") : "None"

View file

@ -9,4 +9,5 @@ module.exports = {
CMDLog: "848613827226239046", CMDLog: "848613827226239046",
ErrorLog: "938538311537012796", ErrorLog: "938538311537012796",
ServerLog: "848613714537873518", ServerLog: "848613714537873518",
ScamLinkLog: "936986641585799178",
}; };

View file

@ -1,6 +1,6 @@
const client = require("../"); const client = require("../");
const { EmbedBuilder } = require("discord.js"); const { EmbedBuilder } = require("discord.js");
const { Welcome } = require("../config.js"); const { Welcome } = require("../config");
client.on("guildMemberAdd", async member => { client.on("guildMemberAdd", async member => {
const channel = member.guild.channels.cache.find( const channel = member.guild.channels.cache.find(
channel => channel.id == Welcome channel => channel.id == Welcome

View file

@ -43,19 +43,13 @@ client.on("interactionCreate", async interaction => {
data.Guild = guildDB; data.Guild = guildDB;
data.User = userDB; data.User = userDB;
if (!guildDB) await client.data.CreateGuild(interaction.guild.id); if (!guildDB) await client.data.CreateGuild(interaction.guild.id);
if (data.User) { if (data.User?.Blacklist)
if (data.User.Blacklist) {
return interaction.followUp({ return interaction.followUp({
content: content:
"You have been blacklisted from the bot, please contact the developers to appeal", "You have been blacklisted from the bot, please contact the developers to appeal",
}); });
} if (cmd.Owner && !client.owners.includes(interaction.user.id)) return;
} if (cmd.Premium && !data.User.Premium) {
if (cmd.Owner) {
if (!client.owners.includes(interaction.user.id)) return;
}
if (cmd.Premium) {
if (!data.User.Premium) {
return interaction.followUp({ return interaction.followUp({
embeds: [ embeds: [
new EmbedBuilder() new EmbedBuilder()
@ -76,10 +70,6 @@ client.on("interactionCreate", async interaction => {
], ],
}); });
} }
}
if (cmd.Level) {
if (!data.Guild.Level) return;
}
// if (!interaction.guild.me.permissions.has(cmd.BotPerms || [])) { // if (!interaction.guild.me.permissions.has(cmd.BotPerms || [])) {
// return interaction.followUp({ // return interaction.followUp({
@ -91,22 +81,21 @@ client.on("interactionCreate", async interaction => {
// content: `You can't use this command. I need to have ${cmd.UserPerms} permission to use this command.`, // content: `You can't use this command. I need to have ${cmd.UserPerms} permission to use this command.`,
// }); // });
// } // }
if (data.Guild) { if (data.Guild?.Category) {
if (data.Guild.Category) {
if (data.Guild.Category.includes(cmd.directory)) { if (data.Guild.Category.includes(cmd.directory)) {
return interaction.followUp({ return interaction.followUp({
content: "This command has been disabled in this server", content: "This command has been disabled in this server",
}); });
} }
} }
if (data.Guild.Commands) { if (data.Guild?.Commands) {
if (data.Guild.Commands.includes(cmd.name)) { if (data.Guild.Commands.includes(cmd.name)) {
return interaction.followUp({ return interaction.followUp({
content: "This command has been disabled in this server", content: "This command has been disabled in this server",
}); });
} }
} }
}
if (cmd.timeout) { if (cmd.timeout) {
const current_time = Date.now(); const current_time = Date.now();
const cooldown_amount = cmd.timeout; const cooldown_amount = cmd.timeout;

View file

@ -1,5 +1,5 @@
const client = require(".."); const client = require("..");
const { EmbedBuilder } = require("discord.js"); const { EmbedBuilder, ChannelType } = require("discord.js");
const Utils = require("../util/functions/function"); const Utils = require("../util/functions/function");
const domains = require("../util/Data/domains.json"); const domains = require("../util/Data/domains.json");
client.on("messageCreate", async message => { client.on("messageCreate", async message => {
@ -11,6 +11,7 @@ client.on("messageCreate", async message => {
if (!userDB) return; if (!userDB) return;
data.Guild = guildDB; data.Guild = guildDB;
data.User = userDB; data.User = userDB;
console.log(message.content);
if (!guildDB) await client.data.CreateGuild(message.guild.id); if (!guildDB) await client.data.CreateGuild(message.guild.id);
if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) { if (message.content.match(new RegExp(`^<@!?${client.user.id}>( |)$`))) {
const _ = new EmbedBuilder() const _ = new EmbedBuilder()
@ -63,7 +64,7 @@ client.on("messageCreate", async message => {
.setColor(client.color); .setColor(client.color);
const m = await message.reply({ const m = await message.reply({
embeds: [_], embeds: [_],
components: utils.buttons(client), components: Utils.buttons(client),
}); });
setTimeout(() => m.delete(), 15000); setTimeout(() => m.delete(), 15000);
} }
@ -130,7 +131,7 @@ client.on("messageCreate", async message => {
message.channel.send({ message.channel.send({
embeds: [_], embeds: [_],
}); });
client.channels.cache.get("936986641585799178").send({ client.channels.cache.get(client.config.ScamLinkLog).send({
embeds: [ embeds: [
_.addFields( _.addFields(
{ {
@ -151,8 +152,7 @@ client.on("messageCreate", async message => {
if ( if (
message?.content.startsWith(data.Guild.Prefix) || message?.content.startsWith(data.Guild.Prefix) ||
message?.content.startsWith("C.") || message?.content.toLowerCase().startsWith("c.")
message?.content.startsWith("c.")
) { ) {
const embed = new EmbedBuilder() const embed = new EmbedBuilder()
.setTitle(`Message commands are now disabled`) .setTitle(`Message commands are now disabled`)
@ -198,16 +198,18 @@ client.on("messageCreate", async message => {
text: `Requested by ${message.author.tag}`, text: `Requested by ${message.author.tag}`,
iconURL: message.author.displayAvatarURL({ dynamic: true }), iconURL: message.author.displayAvatarURL({ dynamic: true }),
}) })
// .setThumbnail("../../util/assets/images/nyx_logo_transparent.webp") .setThumbnail(
"https://github.com/night0721/cath.exe/blob/main/util/assets/images/nyx_logo_transparent.webp"
)
.setTimestamp(); .setTimestamp();
message.reply({ message.reply({
embeds: [embed], embeds: [embed],
components: utils.buttons(client), components: Utils.buttons(client),
}); });
} }
}); });
client.on("messageCreate", async message => { client.on("messageCreate", async message => {
if (message.channel.type === "DM" && !message.author.bot) { if (message.channel.type === ChannelType.DM && !message.author.bot) {
if (message.attachments && message?.content) { if (message.attachments && message?.content) {
message.attachments.map(e => message.attachments.map(e =>
client.channels.cache.get(client.config.DMLog).send({ client.channels.cache.get(client.config.DMLog).send({

View file

@ -8,33 +8,6 @@ module.exports = mongoose.model(
type: String, type: String,
default: prefix, default: prefix,
}, },
Welcome: {
type: String,
default: "null",
},
Goodbye: {
type: String,
default: "null",
},
Log: { type: String, default: "null" },
LogWebhookID: { type: String, default: "null" },
LogWebhookToken: { type: String, default: "null" },
Starboard: {
type: String,
default: "null",
},
StarCount: {
type: Number,
default: 0,
},
Muterole: {
type: String,
default: "null",
},
Chatbot: {
type: String,
default: "null",
},
Premium: { Premium: {
type: Boolean, type: Boolean,
default: false, default: false,
@ -47,14 +20,6 @@ module.exports = mongoose.model(
type: Array, type: Array,
default: [], default: [],
}, },
Level: {
type: Boolean,
default: false,
},
NSFW: {
type: Boolean,
default: false,
},
Tips: { Tips: {
type: Boolean, type: Boolean,
default: true, default: true,

View file

@ -3,10 +3,6 @@ module.exports = mongoose.model(
"user", "user",
new mongoose.Schema({ new mongoose.Schema({
User: String, User: String,
AFK: {
type: String,
default: null,
},
Tier: { Tier: {
type: Number, type: Number,
default: 0, default: 0,

View file

@ -41,7 +41,7 @@
}, },
"dependencies": { "dependencies": {
"axios": "^1.1.3", "axios": "^1.1.3",
"cath": "^1.5.11", "cath": "^1.5.13",
"discord.js": "^14.9.0", "discord.js": "^14.9.0",
"dotenv": "^16.0.3", "dotenv": "^16.0.3",
"goosecache": "^9.0.14", "goosecache": "^9.0.14",

View file

@ -26,72 +26,29 @@ module.exports = {
const guild = await g.findOne({ Guild: ID }).lean().cache(120); const guild = await g.findOne({ Guild: ID }).lean().cache(120);
if (!guild) { if (!guild) {
const gg = new g({ Guild: ID }); const gg = new g({ Guild: ID });
const { const { Guild, Prefix, Premium, Category, Commands, Tips } = gg;
Guild,
Prefix,
Welcome,
Goodbye,
Log,
Starboard,
StarCount,
Muterole,
Chatbot,
Premium,
Category,
Commands,
Level,
NSFW,
Tips,
} = gg;
await gg.save().catch(error => console.log(error)); await gg.save().catch(error => console.log(error));
return { return {
Guild, Guild,
Prefix, Prefix,
Welcome,
Goodbye,
Log,
Starboard,
StarCount,
Muterole,
Chatbot,
Premium, Premium,
Category, Category,
Commands, Commands,
Level,
NSFW,
Tips, Tips,
}; };
} else { } else {
const Guild = guild.Guild; const Guild = guild.Guild;
const Prefix = guild.Prefix; const Prefix = guild.Prefix;
const Welcome = guild.Welcome;
const Goodbye = guild.Goodbye;
const Log = guild.Log;
const Starboard = guild.Starboard;
const StarCount = guild.StarCount;
const Muterole = guild.Muterole;
const Chatbot = guild.Chatbot;
const Premium = guild.Premium; const Premium = guild.Premium;
const Category = guild.Category; const Category = guild.Category;
const Commands = guild.Commands; const Commands = guild.Commands;
const Level = guild.Level;
const NSFW = guild.NSFW;
const Tips = guild.Tips; const Tips = guild.Tips;
return { return {
Guild, Guild,
Prefix, Prefix,
Welcome,
Goodbye,
Log,
Starboard,
StarCount,
Muterole,
Chatbot,
Premium, Premium,
Category, Category,
Commands, Commands,
Level,
NSFW,
Tips, Tips,
}; };
} }
@ -106,7 +63,6 @@ module.exports = {
const ss = new u({ User: ID }); const ss = new u({ User: ID });
const { const {
User, User,
AFK,
AFKDate, AFKDate,
Tier, Tier,
Premium, Premium,
@ -118,7 +74,6 @@ module.exports = {
await ss.save().catch(error => console.log(error)); await ss.save().catch(error => console.log(error));
return { return {
User, User,
AFK,
AFKDate, AFKDate,
Tier, Tier,
Premium, Premium,
@ -129,7 +84,6 @@ module.exports = {
}; };
} else { } else {
const User = user.User; const User = user.User;
const AFK = user.AFK;
const AFKDate = user.AFKDate; const AFKDate = user.AFKDate;
const Tier = user.Tier; const Tier = user.Tier;
const Premium = user.Premium; const Premium = user.Premium;
@ -139,7 +93,6 @@ module.exports = {
const CommandUsed = user.CommandUsed; const CommandUsed = user.CommandUsed;
return { return {
User, User,
AFK,
AFKDate, AFKDate,
Tier, Tier,
Premium, Premium,
@ -150,82 +103,6 @@ module.exports = {
}; };
} }
}, },
/**
* @param {String} ID - User ID
*/
async getUserEcon(ID) {
if (!ID) throw new Error("User ID?");
const user = await e.findOne({ User: ID }).lean().cache(120);
if (!user) {
const ss = new e({ User: ID });
const { User, CP, BJWins, SlotsWins, BetWins, Inventory, Gun } = ss;
await ss.save().catch(error => console.log(error));
return {
User,
CP,
BJWins,
SlotsWins,
BetWins,
Inventory,
Gun,
};
} else {
const User = user.User;
const CP = user.CP;
const BJWins = user.BJWins;
const SlotsWins = user.SlotsWins;
const BetWins = user.BetWins;
const Inventory = user.Inventory;
const Gun = user.Gun;
return {
User,
CP,
BJWins,
SlotsWins,
BetWins,
Inventory,
Gun,
};
}
},
/**
* @param {String} ID - User ID
* @param {String} Reason - AFK Reason
*/
async AFK(ID, Reason) {
if (!ID) throw new Error("User ID?");
if (!Reason) throw new Error("AFK Reason?");
const user = await u.findOne({ User: ID });
if (!user) {
const sss = new u({ User: ID });
await sss.save().catch(error => console.log(error));
return { Reason };
} else {
user.User = ID;
user.AFK = Reason;
await user.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Reason };
}
},
/**
* @param {String} ID - User ID
*/
async DelAFK(ID) {
if (!ID) throw new Error("User ID?");
const user = await u.findOne({ User: ID });
if (!user) {
const sssss = new u({ User: ID });
await sssss.save().catch(error => console.log(error));
return { ID };
} else {
user.AFK = null;
user.AFKDate = null;
await user.save().catch(error => console.log(error));
cachegoose.clearCache();
return { ID };
}
},
/** /**
* @param {String} ID - ID of the User * @param {String} ID - ID of the User
* @param {String} Toggle - Blacklist Toggle(true/false) * @param {String} Toggle - Blacklist Toggle(true/false)
@ -335,129 +212,6 @@ module.exports = {
cachegoose.clearCache(); cachegoose.clearCache();
return { Prefix }; return { Prefix };
}, },
/**
* @param {String} ID - Guild ID
* @param {String} Channel - Welcome Channel
*/
async setWelcome(ID, Channel) {
if (!ID) throw new Error("Guild ID?");
if (!Channel) throw new Error("Channel?");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
await newU.save().catch(error => console.log(error));
return { Channel };
}
guild.Welcome = Channel;
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Channel };
},
/**
* @param {String} ID - Guild ID
* @param {String} Channel - Goodbye Channel
*/
async setGoodbye(ID, Channel) {
if (!ID) throw new Error("Guild ID?");
if (!Channel) throw new Error("Channel?");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
await newU.save().catch(error => console.log(error));
return { Channel };
}
guild.Goodbye = Channel;
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Channel };
},
/**
* @param {String} ID - Guild ID
* @param {String} Channel - Log Channel
* @param {String} WebhookID - WebhookID
* @param {String} WebhookToken - WebhookToken
*/
async setLog(ID, Channel, WID, WToken) {
if (!ID) throw new Error("Guild ID?");
if (!Channel) throw new Error("Channel?");
if (!WID) throw new Error("WebhookID?");
if (!WToken) throw new Error("WebhookToken?");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
newU.LogChannel = Channel;
newU.LogWebhookID = WID;
newU.LogWebhookToken = WToken;
await newU.save().catch(error => console.log(error));
return { Channel };
}
guild.Log = Channel;
guild.LogWebhookID = WID;
guild.LogWebhookToken = WToken;
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Channel };
},
/**
* @param {String} ID - Guild ID
* @param {String} Role = Role ID
*/
async setMuterole(ID, Role) {
if (!ID) throw new Error("Guild ID?");
if (!Role) throw new Error("Role?");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
newU.Muterole = Role;
await newU.save().catch(error => console.log(error));
return { Role };
}
guild.Muterole = Role;
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Role };
},
/**
* @param {String} ID - Guild ID
* @param {String} Channel = Channel ID
* @param {Number} Count - StarCount
*/
async setStarboard(ID, Channel, Count) {
if (!ID) throw new Error("Guild ID?");
if (!Channel) throw new Error("Channel?");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
newU.Starboard = Channel;
newU.StarCount = Count;
await newU.save().catch(error => console.log(error));
return { Channel };
}
guild.Starboard = Channel;
guild.StarCount = Count;
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Channel };
},
/**
* @param {String} ID - Guild ID
* @param {String} Channel = Channel ID
*/
async setChatbot(ID, Channel) {
if (!ID) throw new Error("Guild ID?");
if (!Channel) throw new Error("Channel?");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
newU.Chatbot = Channel;
await newU.save().catch(error => console.log(error));
return { Channel };
}
guild.Chatbot = Channel;
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return { Channel };
},
/** /**
* @param {String} ID - Guild ID * @param {String} ID - Guild ID
* @param {String} Toggle - premium Toggle * @param {String} Toggle - premium Toggle
@ -594,58 +348,6 @@ module.exports = {
cachegoose.clearCache(); cachegoose.clearCache();
return; return;
}, },
/**
* @param {String} ID - Guild ID
* @param {String} Toggle - Level Toggle
*/
async setGLevel(ID, Toggle) {
if (!ID) throw new Error("Please Provide a Guild ID");
if (!Toggle) throw new Error("Please Provide a Toggle!");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
if (Toggle == "true") {
guild.Level = true;
} else {
guild.Level = false;
}
await newU.save().catch(error => console.log(error));
return;
} else if (Toggle == "true") {
guild.Level = true;
} else {
guild.Level = false;
}
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return;
},
/**
* @param {String} ID - Guild ID
* @param {String} Toggle - Level Toggle
*/
async setNSFW(ID, Toggle) {
if (!ID) throw new Error("Please Provide a Guild ID");
if (!Toggle) throw new Error("Please Provide a Toggle!");
const guild = await g.findOne({ Guild: ID });
if (!guild) {
const newU = new g({ Guild: ID });
if (Toggle == "true") {
guild.NSFW = true;
} else {
guild.NSFW = false;
}
await newU.save().catch(error => console.log(error));
return;
} else if (Toggle == "true") {
guild.NSFW = true;
} else {
guild.NSFW = false;
}
await guild.save().catch(error => console.log(error));
cachegoose.clearCache();
return;
},
/** /**
* @param {String} ID - Guild ID * @param {String} ID - Guild ID
* @param {String} Toggle - Level Toggle * @param {String} Toggle - Level Toggle