Client. login error issue

I suspect it's a network issue in my area, but I have tested several methods but none of them can solve it
const { **fetch**, **setGlobalDispatcher**, Agent } =**require** ('undici')



**setGlobalDispatcher**(new **Agent**({ connect: { timeout: 60_000 } }) )

// 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).

// The distinction between `client: Client<boolean>` and `readyClient: Client<true>` is important for TypeScript developers.

// It makes some properties non-nullable.

client.**once**(Events.ClientReady, (readyClient) => {

console.**log**(`Ready! Logged in as ${readyClient.user.tag}`);

});

client.**on**(Events.messageCreate,(message)=>{

if (message.content ==="ss"){

message.channel.**send**("hello")

}

})



// Log in to Discord with your client's token

client.**login**(token);
const { **fetch**, **setGlobalDispatcher**, Agent } =**require** ('undici')



**setGlobalDispatcher**(new **Agent**({ connect: { timeout: 60_000 } }) )

// 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).

// The distinction between `client: Client<boolean>` and `readyClient: Client<true>` is important for TypeScript developers.

// It makes some properties non-nullable.

client.**once**(Events.ClientReady, (readyClient) => {

console.**log**(`Ready! Logged in as ${readyClient.user.tag}`);

});

client.**on**(Events.messageCreate,(message)=>{

if (message.content ==="ss"){

message.channel.**send**("hello")

}

})



// Log in to Discord with your client's token

client.**login**(token);
No description
2 Replies
d.js toolkit
d.js toolkit3mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
a'b'c
a'b'c3mo ago
I tried using the clash global proxy, but the result was not good either. Do you know if there are any other solutions