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