Weird issues with different computers

So I had an old laptop where i messed around with bots a lot and it worked perfectly fine. I decided to get into discord.js for bot creation but this was on a new desktop that i had bought. When i tried the code from the tutorial, nothing happened. I wasnt sure what was going on so i did the EXACT same thing with the old laptop i was using and it worked perfectly fine. Both have the same Node.js, Discord.js, everything is basically the same when it came to the file. The only difference was the 2 computers, but the laptop worked and the desktop didnt. Any tips on getting it working on my desktop?
10 Replies
d.js toolkit
d.js toolkit2y ago
- What's your exact discord.js npm list discord.js and node node -v version? - Post the full error stack trace, not just the top part! - Show your code! - Explain what exactly your issue is. - Not a discord.js issue? Check out #useful-servers. - Issue solved? Press the button!
treble/luna
treble/luna2y ago
define does not work, do you get any errors, etc etc
Russia
RussiaOP2y ago
so nothing shows up in the terminal when i run it. Normally it does the whole "Bot is ready" thing but when i type node . nothing happens ive made sure all the packages are installed and its the right file
d.js docs
d.js docs2y ago
Please add the following code to your code base outside of any other event listeners and provide the full log output relevant to your issue.
client
.on("debug", console.log)
.on("warn", console.log)
client
.on("debug", console.log)
.on("warn", console.log)
- Note: if you initialize your Client as bot or other identifiers you need to use these instead of client - If the output is too long to post consider using a bin instead: gist | paste.gg | sourceb.in | hastebin
Russia
RussiaOP2y ago
HEres my full index.js with that bit,
// Require the necessary discord.js classes
const { Client, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

// Create a new client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

// When the client is ready, run this code (only once)
// We use 'c' for the event parameter to keep it separate from the already defined 'client'
client.once(Events.ClientReady, c => {
console.log(`Ready! Logged in as ${c.user.tag}`);
});

// Log in to Discord with your client's token
client.login(token);

client
.on("debug", console.log)
.on("warn", console.log)
// Require the necessary discord.js classes
const { Client, Events, GatewayIntentBits } = require('discord.js');
const { token } = require('./config.json');

// Create a new client instance
const client = new Client({ intents: [GatewayIntentBits.Guilds] });

// When the client is ready, run this code (only once)
// We use 'c' for the event parameter to keep it separate from the already defined 'client'
client.once(Events.ClientReady, c => {
console.log(`Ready! Logged in as ${c.user.tag}`);
});

// Log in to Discord with your client's token
client.login(token);

client
.on("debug", console.log)
.on("warn", console.log)
nothing differnt happened
Russia
RussiaOP2y ago
Russia
RussiaOP2y ago
Russia
RussiaOP2y ago
uhm idk
Russia
RussiaOP2y ago
didnt save yet heres the updated one
Russia
RussiaOP2y ago
oh god one sec i think i might have gotten it working nothing was "saved" even though it was saved i guess
Want results from more Discord servers?
Add your server