racinggecko
racinggecko
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
fixed node error, trying what you did
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
can't revert to old node version
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
yes
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
other packages I used in the bot were compiled with node module version 72 and when it updated it now requires version 115
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
it updated to 20.5.0 when I tried to run deploy-commands.js now but now my bot code doesn't work with latest version
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
version is 17.9.0
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
ok
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
in the code or console command?
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
Error: Cannot find module 'node:fs' Require stack: - /home/runner/bot-1/deploy-commands.js at Function.Module._resolveFilename (internal/modules/cjs/loader.js:815:15) at Function.Module._load (internal/modules/cjs/loader.js:667:27) at Module.require (internal/modules/cjs/loader.js:887:19) at require (internal/modules/cjs/helpers.js:74:18) at Object.<anonymous> (/home/runner/bot-1/deploy-commands.js:3:12) at Module._compile (internal/modules/cjs/loader.js:999:30) at Object.Module._extensions..js (internal/modules/cjs/loader.js:1027:10) at Module.load (internal/modules/cjs/loader.js:863:32) at Function.Module._load (internal/modules/cjs/loader.js:708:14) at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:60:12) { code: 'MODULE_NOT_FOUND', requireStack: [ '/home/runner/bot-1/deploy-commands.js' ]
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
I used node deploy-commands.js
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
/home/runner/bot-1/handler/console.js:5 bot.channels.cache.get(message.channel.id).send(x.join(" ")); ^ TypeError: Cannot read property 'channel' of undefined at ReadStream.<anonymous> (/home/runner/Lizard-1/handler/console.js:5:44) at ReadStream.emit (events.js:314:20) at addChunk (_stream_readable.js:297:12) at readableAddChunk (_stream_readable.js:272:9) at ReadStream.Readable.push (_stream_readable.js:213:10) at TTY.onStreamRead (internal/stream_base_commons.js:188:23) exit status 1
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
and here's the error
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
const { REST, Routes } = require('discord.js');
const { CLIENT_ID, SERVER_ID, TOKEN } = require('./config.js');
const fs = require('node:fs');
const path = require('node:path');

const commands = [mod, utility];
// Grab all the command files from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands');
const commandsPath = fs.readdirSync(commands);
n
for (const folder of command) {
// Grab all the command files from the commands directory you created earlier
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('data' in command && 'execute' in command) {
commands.push(command.data.toJSON());
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}

// Construct and prepare an instance of the REST module
const rest = new REST().setToken(token);

// and deploy your commands!
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);

// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationGuildCommands(CLIENT_ID, SERVER_ID),
{ body: commands },
);

console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
// And of course, make sure you catch and log any errors!
console.error(error);
}
})();
const { REST, Routes } = require('discord.js');
const { CLIENT_ID, SERVER_ID, TOKEN } = require('./config.js');
const fs = require('node:fs');
const path = require('node:path');

const commands = [mod, utility];
// Grab all the command files from the commands directory you created earlier
const foldersPath = path.join(__dirname, 'commands');
const commandsPath = fs.readdirSync(commands);
n
for (const folder of command) {
// Grab all the command files from the commands directory you created earlier
const commandsPath = path.join(foldersPath, folder);
const commandFiles = fs.readdirSync(commandsPath).filter(file => file.endsWith('.js'));
// Grab the SlashCommandBuilder#toJSON() output of each command's data for deployment
for (const file of commandFiles) {
const filePath = path.join(commandsPath, file);
const command = require(filePath);
if ('data' in command && 'execute' in command) {
commands.push(command.data.toJSON());
} else {
console.log(`[WARNING] The command at ${filePath} is missing a required "data" or "execute" property.`);
}
}
}

// Construct and prepare an instance of the REST module
const rest = new REST().setToken(token);

// and deploy your commands!
(async () => {
try {
console.log(`Started refreshing ${commands.length} application (/) commands.`);

// The put method is used to fully refresh all commands in the guild with the current set
const data = await rest.put(
Routes.applicationGuildCommands(CLIENT_ID, SERVER_ID),
{ body: commands },
);

console.log(`Successfully reloaded ${data.length} application (/) commands.`);
} catch (error) {
// And of course, make sure you catch and log any errors!
console.error(error);
}
})();
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
yes
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
it says I should be able to type / and see my bot but I still can't do so, even though the code has no errors
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
ok, I've finished writing the code for deploying
44 replies
DIAdiscord.js - Imagine an app
Created by racinggecko on 8/21/2023 in #djs-questions
Enabling / commands
no, how do I do so? sorry, I'm new to discord.js
44 replies