Wednesday, 17 May 2017

discord 1 minute interval message

Hello I'm trying to send out an automated message to discord but I keep getting errors.. I keep getting the error bot.sendMessage is not a function and I don't know why.

var Discord = require('discord.js');
var bot = new Discord.Client()

bot.on('ready', function() {
    console.log(bot.user.username);
});

bot.on('message', function(message) {
    if (message.content === "$loop") { 
      var interval = setInterval (function () {
        bot.sendMessage("123");
      }, 1 * 1000); 
    }
  });



via fragile

No comments:

Post a Comment