不和谐.JS我的机器人不上线,但有一个简单的代码



我的机器人不会联机,但有一个简单的代码:

const discord = require('discord.js')
const client = new discord.Client();
const token = ('my bot token')
client.on('ready', function(){
console.log('online')
})
client.login(token)

试试这个:

const discord = require('discord.js')
const client = new discord.Client(); 
// you will want to define some intents if you want the bot to be able to do anything
// see https://discordjs.guide/popular-topics/intents.html#enabling-intents and https://discord.js.org/#/docs/main/stable/class/Intents
const token = 'my bot token' // took away the ()
client.on('ready', () => { //removed 'function' and added => to pass everything through
console.log('online')
})
client.login(token)

相关内容

  • 没有找到相关文章

最新更新