Formatting changes

This commit is contained in:
2023-06-14 19:10:34 +02:00
parent b0a31b65dc
commit 703bd8ae26

View File

@@ -1,19 +1,19 @@
const {Client, GatewayIntentBits, Partials, ActivityType, Events, Collection} = require('discord.js'); const { Client, GatewayIntentBits, Partials, ActivityType, Events, Collection } = require('discord.js');
const {botLogChannel, color} = require('./config/options.json'); const { botLogChannel, color } = require('./config/options.json');
const env = require('dotenv').config(); const env = require('dotenv').config();
const token = process.env.TOKEN; const token = process.env.TOKEN;
const mongoURI = process.env.MONGOURI; const mongoURI = process.env.MONGOURI;
const {connect} = require('mongoose'); const { connect } = require('mongoose');
const path = require('path'); const path = require('path');
const fs = require('fs'); const fs = require('fs');
const client = new Client({ const client = new Client({
intents : [ intents: [
GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages,
GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent,
GatewayIntentBits.DirectMessages GatewayIntentBits.DirectMessages
], ],
partials : [ partials: [
Partials.GuildMember, Partials.User, Partials.Message, Partials.Channel Partials.GuildMember, Partials.User, Partials.Message, Partials.Channel
] ]
}); });
@@ -34,8 +34,7 @@ for (const file of cmdFiles) {
if ('data' in cmd && 'execute' in cmd && cmd.type === 'slash') { if ('data' in cmd && 'execute' in cmd && cmd.type === 'slash') {
client.commands.set(cmd.data.name, cmd); client.commands.set(cmd.data.name, cmd);
} else { } else {
console.log(`[WARNING] The command at ${ console.log(`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`);
filePath} is missing a required "data", "execute" or "type" property.`);
} }
} }
@@ -52,8 +51,7 @@ for (const file of cmdTestFiles) {
if ('data' in cmd && 'execute' in cmd && cmd.type === 'slash') { if ('data' in cmd && 'execute' in cmd && cmd.type === 'slash') {
client.commands.set(cmd.data.name, cmd); client.commands.set(cmd.data.name, cmd);
} else { } else {
console.log(`[WARNING] The command at ${ console.log(`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`);
filePath} is missing a required "data", "execute" or "type" property.`);
} }
} }
@@ -74,8 +72,8 @@ client.on(Events.InteractionCreate, async interaction => {
} catch (error) { } catch (error) {
console.error(error); console.error(error);
await interaction.reply({ await interaction.reply({
content : 'There was an error while executing this command!', content: 'There was an error while executing this command!',
ephemeral : true ephemeral: true
}) })
} }
}); });
@@ -93,8 +91,7 @@ for (const file of contextMenuFiles) {
if ('data' in cmd && 'execute' in cmd && cmd.type === 'contextmenu') { if ('data' in cmd && 'execute' in cmd && cmd.type === 'contextmenu') {
client.commands.set(cmd.data.name, cmd); client.commands.set(cmd.data.name, cmd);
} else { } else {
console.log(`[WARNING] The command at ${ console.log(`[WARNING] The command at ${filePath} is missing a required "data", "execute" or "type" property.`);
filePath} is missing a required "data", "execute" or "type" property.`);
} }
} }
@@ -115,8 +112,8 @@ client.on(Events.InteractionCreate, async interaction => {
} catch (error) { } catch (error) {
console.error(error); console.error(error);
await interaction.reply({ await interaction.reply({
content : 'There was an error while executing this command!', content: 'There was an error while executing this command!',
ephemeral : true ephemeral: true
}) })
} }
}); });
@@ -133,8 +130,7 @@ for (const file of btnFiles) {
if ('name' in btn && 'execute' in btn && btn.type === 'button') { if ('name' in btn && 'execute' in btn && btn.type === 'button') {
client.events.set(btn.name, btn); client.events.set(btn.name, btn);
} else { } else {
console.log(`[WARNING] The button at ${ console.log(`[WARNING] The button at ${filePath} is missing a required "name", "execute" or "type" property.`);
filePath} is missing a required "name", "execute" or "type" property.`);
} }
} }
@@ -155,8 +151,8 @@ client.on(Events.InteractionCreate, async event => {
} catch (error) { } catch (error) {
console.error(error); console.error(error);
await event.reply({ await event.reply({
content : 'There was an error while executing this event!', content: 'There was an error while executing this event!',
ephemeral : true ephemeral: true
}) })
} }
}) })
@@ -174,8 +170,7 @@ for (const file of modalFiles) {
if ('name' in modal && 'execute' in modal && modal.type === 'modal') { if ('name' in modal && 'execute' in modal && modal.type === 'modal') {
client.on(Events.InteractionCreate, modal.execute); client.on(Events.InteractionCreate, modal.execute);
} else { } else {
console.log(`[WARNING] The modal at ${ console.log(`[WARNING] The modal at ${filePath} is missing a required "name", "execute" or "type" property.`);
filePath} is missing a required "name", "execute" or "type" property.`);
} }
} }
@@ -201,21 +196,21 @@ client.on(Events.ClientReady, () => {
} }
channel.send( channel.send(
{embeds : [ {description : `Bot is online!`, color : embedColor} ]}); { embeds: [{ description: `Bot is online!`, color: embedColor }] });
}); });
client.on(Events.ClientReady, () => { client.on(Events.ClientReady, () => {
client.user.setActivity( client.user.setActivity(
{name : "over the Illegitimate Server", type : ActivityType.Watching}); { name: "over the Illegitimate Server", type: ActivityType.Watching });
const activities = [ const activities = [
{name : "with Jone the idiot", type : ActivityType.Playing}, { name: "with Jone the idiot", type: ActivityType.Playing },
{name : "with Martina the bot", type : ActivityType.Playing}, { name: "with Martina the bot", type: ActivityType.Playing },
{name : "urCryhard steal finals again", type : ActivityType.Watching}, { name: "urCryhard steal finals again", type: ActivityType.Watching },
{name : "with Perlcence the AI", type : ActivityType.Playing}, { name: "with Perlcence the AI", type: ActivityType.Playing },
{name : "my creator Taken", type : ActivityType.Watching}, { name: "my creator Taken", type: ActivityType.Watching },
{name : "with ur mom in my bed", type : ActivityType.Playing}, { name: "with ur mom in my bed", type: ActivityType.Playing },
{name : "over the Illegitimate Server", type : ActivityType.Watching} { name: "over the Illegitimate Server", type: ActivityType.Watching }
]; ];
let i = 0; let i = 0;