[英]node . when i press run nothing happens (discord.js)
Why isn't it working?为什么它不起作用? I tried reinstall the app and re-install the npm install discord.js and iI'm still facing it ?我尝试重新安装应用程序并重新安装 npm install discord.js 并且我仍然面临它?
When I press node, nothing happens:当我按下节点时,没有任何反应:
index.js索引.js
const { Client, Intents } = require('discord.js');
const { token, prefix } = require('./config.json');
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
]
});
client.on('ready', () => {
console.log('the bot is ready')
})
client.on('messageCreate', message => {
if (message.content === prefix + 'hi') {
message.reply('hello')
}
})
client.login(token);
config.json配置文件
{
"token": "TOKEN",
"prefix": "$"
}
That probably is because you havent provided a valid bot token in config.json am I right or did you type TOKEN in the token field to redact it.这可能是因为您没有在 config.json 中提供有效的机器人令牌,我是对的,还是您在令牌字段中键入 TOKEN 来编辑它。
This is the only issue I can find as of now这是我目前能找到的唯一问题
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.