Hello, Trying to set a game that the bot is playing. Here is my code :
and here is the error I get,
Code:
// CALLING THE PACKAGE
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.login(')
bot.on('ready', () => {
console.log('Bot started')
bot.setGame('Watching L00ting')
});
bot.on('message', message => {
if(message.content.toLowerCase() === 'hello')
message.channel.send('Hi there!' + message.author);
if(message.content.toLowerCase() === 'test2')
message.channel.send('Hi there!' + message.author);
if(message.content.toLowerCase() === 'test')
message.channel.send('Hi there!' + message.author);
});
and here is the error I get,
Code:
^
TypeError: bot.setGame is not a function
at Client.bot.on (C:\Users\Felix\Desktop\DISCORD BOT\app.js:8:7)
at emitNone (events.js:111:20)
at Client.emit (events.js:208:7)
at WebSocketConnection.triggerReady (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:125:17)
at WebSocketConnection.checkIfReady (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:141:61)
at GuildCreateHandler.handle (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\discord.js\src\client\websocket\packets\handlers\GuildCreate.js:13:31)
at WebSocketPacketManager.handle (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\discord.js\src\client\websocket\packets\WebSocketPacketManager.js:103:65)
at WebSocketConnection.onPacket (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:333:35)
at WebSocketConnection.onMessage (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\discord.js\src\client\websocket\WebSocketConnection.js:296:17)
at WebSocket.onMessage (C:\Users\Felix\Desktop\DISCORD BOT\node_modules\ws\lib\event-target.js:120:16)

