최근에 나는 불화 봇을 만들려고 노력해 왔습니다. start.bat 파일을 실행할 때까지 모든 것이 잘 진행되었습니다. 여기 불화 봇이 왜 작동하지 않습니까?
client.on('ready',() => {
^
SyntaxError: Unexpected token)
at exports.runInThisContext (vm.js:73:16)
at Module._compile (module.js:443:25)
at Object.Module._extensions..js (module.js:478:10)
at Module.load (module.js:355:32)
at Function.Module._load (module.js:310:12)
at Function.Module.runMain (module.js:501:10)
at startup (node.js:129:16)
at node.js:814:3
내가지면에서 봇 얻기 위해 사용하고 샘플 코드입니다 : 최대한 빨리 실행으로,이 얻을
const Discord = require("discord.js");
const client = new Discord.Client();
client.login('MzEzNzc1NzUwOTQxNTA3NTg0.C_-ilQ.vJyMW_Q2PjLLntwgifRRCnjPw88')
client.on('ready',() => {
console.log(`Logged in as ${client.user.username}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('Pong!');
}
});
client.login('token');
을 내 start.bat 파일 :
을2 info using [email protected]
3 info using [email protected]
: 마지막으로
@echo off
node bot.js
PAUSE
, 여기에 버전 정보입니다
이것이 무슨 뜻인지 실마리를 고칠 수 있습니까?
[전체 관련 코드] (https://stackoverflow.com/help/mcve)와 사용중인 Node.js 버전을 게시하십시오. 게시 한 오류 메시지는 구문 오류가 있음을 나타내지 만 문제가 실제로 무엇인지 파악하기에는 충분하지 않습니다. – Frxstrem
이것은 구문 오류입니다. 즉, 코드를 구문 분석하는 방법을 알지 못한다는 의미입니다. 사용중인 Node의 버전은 무엇입니까? 속기 대신 일반 익명 함수를 사용하여 작동합니까? – solarc