【发布时间】:2017-10-17 05:58:37
【问题描述】:
您好,我正在尝试向 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);
}
});
【问题讨论】:
标签: javascript node.js discord