English 中文(简体)
const Client = (module.exports = new Client({ intents: [131071] }));
原标题:

index.js

const { Client } = require( discord.js );
const Client = (module.exports = new Client({ intents: [131071] }));
const dotenv = require( dotenv );
dotenv.config();
Client.login(process.env.TOKEN);

Client.once( ready , async () => {
    console.log( ${client.user.tag}(${client.user.id})로 로그인 되었습니다. );
});

여기까지 제가 원하는 코드를 작성하였습니다.

terminal

C:UsersinhuiDesktopdiscordindex.js:2
const Client = (module.exports = new Client({ intents: [131071] }));
      ^

SyntaxError: Identifier  Client  has already been declared
    at internalCompileFunction (node:internal/vm:73:18)
    at wrapSafe (node:internal/modules/cjs/loader:1176:20)
    at Module._compile (node:internal/modules/cjs/loader:1218:27)
    at Module._extensions..js (node:internal/modules/cjs/loader:1308:10)
    at Module.load (node:internal/modules/cjs/loader:1117:32)
    at Module._load (node:internal/modules/cjs/loader:958:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
    at node:internal/main/run_main_module:23:47

Node.js v18.16.0

하지만 터미널에서 코드가 먹히지 않고, 무엇이 잘못인지 확인되지가 않습니다. 무엇이 잘못 되었는지 확인이 필요합니다.

问题回答

暂无回答




相关问题
selected text in iframe

How to get a selected text inside a iframe. I my page i m having a iframe which is editable true. So how can i get the selected text in that iframe.

How to fire event handlers on the link using javascript

I would like to click a link in my page using javascript. I would like to Fire event handlers on the link without navigating. How can this be done? This has to work both in firefox and Internet ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Clipboard access using Javascript - sans Flash?

Is there a reliable way to access the client machine s clipboard using Javascript? I continue to run into permissions issues when attempting to do this. How does Google Docs do this? Do they use ...

javascript debugging question

I have a large javascript which I didn t write but I need to use it and I m slowely going trough it trying to figure out what does it do and how, I m using alert to print out what it does but now I ...

Parsing date like twitter

I ve made a little forum and I want parse the date on newest posts like twitter, you know "posted 40 minutes ago ","posted 1 hour ago"... What s the best way ? Thanx.

热门标签