discord bot difficulties

[Lotto] Streety6000
Joined 26/11/2017
Posts 118
12:55 AM 06/11/2019
ok so i posted this early in off-topic, but im developing a discord bot, and im having trouble making a bulk delete command, here's my script (obviously in node.js)



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

///variables
var version = '1.0.6'

const token = 'redacted';

const PREFIX = '!';

bot.on('ready', () =>{
console.log('bot currently online');
})

bot.on('message', msg=>{

let args = msg.content.substring(PREFIX.length).split(" ");

switch(args[0]){
case 'hello':
msg.channel.sendMessage('hello there!');
break;
case 'info':
if(args[1] === 'version'){
msg.channel.sendMessage('Version: ' + version);
}else{
msg.channel.sendMessage('Invalid Arguments')
}
break;

case 'clear':
if(!args[1]) return msg.reply('Error, define second argument.')
msg.channel.bulkDelete(args[1]);
break;

}
})

bot.login(token);


[DN] Compass
Joined 20/03/2019
Posts 90,100
12:56 AM 06/11/2019
nice code


[Lotto] Streety6000
Joined 26/11/2017
Posts 118
12:57 AM 06/11/2019
thanks

keystrokes


[Lotto] Streety6000
Joined 26/11/2017
Posts 118
01:00 AM 06/11/2019
alright im an idiot
i went back to check and it turns out i didnt grant my bot permissions :face_palm:


brick-techno
Joined 17/08/2019
Posts 11,983
11:51 PM 06/11/2019
WOW!!!!!


Vague
Joined 23/08/2019
Posts 71,957
02:25 PM 21/11/2019
Nice difficult

1