Currently, I am developing a bot and testing its messaging functionality using .sendMessage method.
(I prefer the bot not to send messages upon receiving any input, hence avoiding the use of:
bot.on("message", function(message) {});
However, I am encountering an error stating that .sendMessage is not recognized as a function.
const Discord = require('discord.js');
const getJSON = require('get-json');
const BotToken = "token";
const bot = new Discord.Client();
bot.login(BotToken);
bot.sendMessage('serverid', 'test');
I have already executed npm install discord.js assuming it was included in the discord.js package.
.setStreaming results in a similar error. Although I followed their tutorial at where they recommend using npm install --save --msvs_version=2015 discord.js, I still face this issue.
Does anyone know what could be causing this problem?