average monarchist fan
average monarchist fan
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
also, how did you even find out from image
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
nvm
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
?
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
No description
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
you can clearly see
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
..
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
i just give up ig
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
uh
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
when i returned to the project, i didnt change anything from that
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
but I have
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
now this pops-up: Error: Cannot find module '../config.json' Require stack: - C:\Users\fanmo\OneDrive\Plocha\taubine\index.js at Module._resolveFilename (node:internal/modules/cjs/loader:1077:15) at Module._load (node:internal/modules/cjs/loader:922:27) at Module.require (node:internal/modules/cjs/loader:1143:19) at require (node:internal/modules/cjs/helpers:121:18) at Object.<anonymous> (C:\Users\fanmo\OneDrive\Plocha\taubine\index.js:4:19) at Module._compile (node:internal/modules/cjs/loader:1256:14) at Module._extensions..js (node:internal/modules/cjs/loader:1310:10) at Module.load (node:internal/modules/cjs/loader:1119:32) at Module._load (node:internal/modules/cjs/loader:960:12) at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12) { code: 'MODULE_NOT_FOUND', requireStack: [ 'C:\Users\fanmo\OneDrive\Plocha\taubine\index.js' ] } Node.js v18.17.1
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
well it's the same
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
client.on('interactionCreate', async (interaction) => { // Your existing code here // Logging the 'command' variable console.log(command); // Rest of your code here }); ?
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
I'm back
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
const { Events } = require('discord.js'); module.exports = { name: Events.InteractionCreate, async execute(interaction) { if (!interaction.isChatInputCommand()) return; const command = interaction.client.commands.get(interaction.commandName); if (!command) { console.error(No command matching ${interaction.commandName} was found.); return; } try { await command.execute(interaction); } catch (error) { console.error(Error executing ${interaction.commandName}); console.error(error); } }, };
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
const { Events } = require('discord.js'); module.exports = { name: Events.ClientReady, once: true, execute(client) { console.log(Ready! Logged in as ${client.user.tag}); }, };
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
I give up ig
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
interactionCreate.js and ready.js
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
y
55 replies
DIAdiscord.js - Imagine an app
Created by average monarchist fan on 8/30/2023 in #djs-questions
error
my index.js looks like that rn: const fs = require('node:fs'); const path = require('node:path'); const { Client, Collection, GatewayIntentBits } = require('discord.js'); const { token } = require('./config.json'); const client = new Client({ intents: [GatewayIntentBits.Guilds] }); client.commands = new Collection(); const foldersPath = path.join(dirname, 'commands'); const commandFolders = fs.readdirSync(foldersPath); for (const folder of commandFolders) { const commandsPath = path.join(foldersPath, folder); const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js')); for (const file of commandFiles) { const filePath = path.join(commandsPath, file); const command = require(filePath); if ('data' in command && 'execute' in command) { client.commands.set(command.data.name, command); } else { console.log([WARNING] The command at ${filePath} is missing a required "data" or "execute" property.); } } } const eventsPath = path.join(dirname, 'events'); const eventFiles = fs.readdirSync(eventsPath).filter(file => file.endsWith('.js')); for (const file of eventFiles) { const filePath = path.join(eventsPath, file); const event = require(filePath); if (event.once) { client.once(event.name, (...args) => event.execute(...args)); } else { client.on(event.name, (...args) => event.execute(...args)); } } client.login(token);
55 replies