你好,我正在尝试向Discord发送自动化消息,但我一直收到以下错误提示:
我不确定为什么会出现这个错误,以下是我的代码:
bot.sendMessage is not a function
我不确定为什么会出现这个错误,以下是我的代码:
var Discord = require('discord.js');
var bot = new Discord.Client()
bot.on('ready', function() {
console.log(bot.user.username);
});
bot.on('message', function() {
if (message.content === "$loop") {
var interval = setInterval (function () {
bot.sendMessage(message.channel, "123")
}, 1 * 1000);
}
});