My formatting

This commit is contained in:
2023-08-31 23:20:50 +02:00
parent 342c011788
commit d6e79959fc

View File

@@ -9,12 +9,17 @@ const fs = require('fs');
const client = new Client({ const client = new Client({
intents: [ intents: [
GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent, GatewayIntentBits.GuildMessages,
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
] ]
}); });
@@ -40,8 +45,7 @@ for (const file of cmdFiles) {
//! commands testing //! commands testing
const cmdTestPath = path.join(__dirname, 'commands-testing'); const cmdTestPath = path.join(__dirname, 'commands-testing');
const cmdTestFiles = const cmdTestFiles = fs.readdirSync(cmdTestPath).filter(file => file.endsWith('.js'));
fs.readdirSync(cmdTestPath).filter(file => file.endsWith('.js'));
for (const file of cmdTestFiles) { for (const file of cmdTestFiles) {
@@ -80,8 +84,7 @@ client.on(Events.InteractionCreate, async interaction => {
//! commands //! commands
const contextMenuPath = path.join(__dirname, 'commands-contextmenu'); const contextMenuPath = path.join(__dirname, 'commands-contextmenu');
const contextMenuFiles = const contextMenuFiles = fs.readdirSync(contextMenuPath).filter(file => file.endsWith('.js'));
fs.readdirSync(contextMenuPath).filter(file => file.endsWith('.js'));
for (const file of contextMenuFiles) { for (const file of contextMenuFiles) {
@@ -159,8 +162,7 @@ client.on(Events.InteractionCreate, async event => {
//! modals //! modals
const modalPath = path.join(__dirname, 'events', 'modals'); const modalPath = path.join(__dirname, 'events', 'modals');
const modalFiles = const modalFiles = fs.readdirSync(modalPath).filter(file => file.endsWith('.js'));
fs.readdirSync(modalPath).filter(file => file.endsWith('.js'));
for (const file of modalFiles) { for (const file of modalFiles) {
@@ -178,11 +180,13 @@ client.on(Events.InteractionCreate, async interaction => {
if (interaction.isCommand()) { if (interaction.isCommand()) {
console.log(interaction.user.username + "#" + console.log(interaction.user.username + "#" +
interaction.user.discriminator + " ran " + interaction.user.discriminator + " ran " +
interaction.commandName); interaction.commandName
);
} else if (interaction.isButton()) { } else if (interaction.isButton()) {
console.log(interaction.user.username + "#" + console.log(interaction.user.username + "#" +
interaction.user.discriminator + " clicked " + interaction.user.discriminator + " clicked " +
interaction.customId); interaction.customId
);
} }
}); });
@@ -195,8 +199,12 @@ client.on(Events.ClientReady, () => {
return; return;
} }
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, () => {
@@ -215,10 +223,15 @@ client.on(Events.ClientReady, () => {
let i = 0; let i = 0;
setInterval(() => setInterval(() =>
client.user.setActivity(activities[i++ % activities.length]), client.user.setActivity(
1000 * 60 * 30) activities[i++ % activities.length]
),
1000 * 60 * 30
)
});
client.on(Events.ClientReady, () => {
client.user.setStatus('dnd');
}); });
client.on(Events.ClientReady, () => { client.user.setStatus('dnd'); });
client.login(token); client.login(token);
connect(mongoURI, {}).then(() => { connect(mongoURI, {}).then(() => {