Hi, so I was in the middle of scripting my bot, and I tried to turn it on but it won’t.
This is the code:
const Discord = require('discord.js')
const bot = new Discord.Client();
bot.on('ready', () => {
console.log('Bot online')
})
bot.on('message', (message) => {
if(message.author.bot) return;
if(message.channel.type !== 'text') return;
let prefix = '!';
// here there ['hello', 'there']
// !ban user reason []
let MessageArray = message.content.split(' ');
let cmd = MessageArray[0].slice(prefix.length)
let args = MessageArray.slice(1)
if(!message.content.startsWith(prefix)) return;
if(cmd == 'hello') {
message.channel.send('Hello');
}
})
bot.login("my key")
And this is the error I’m getting:
I do have Node.JS installed.
Noah
2
Eeek, everybody is using js instead of python.
Next time
search & also include the error inside of your title!
Discord Bot Error - Scripting Support / Alternate Language - Cookie Tech (thecookie.dev)
I’ve tried that and it still won’t turn on. I still get the same error.
Noah
4
What changes have you made?
I’ve turned all the intents on, but it is still doing nothing.
Noah
6
Read this please, that’s not what the solution was.
Noah
7
Also, please use slash commands, slash commands will be enforced soon.
Once again, I have a weak understanding of javascript so I’m not the best to help you on this.
Noah
8
Check this please
@HayHay
1 Like
system
Closed
12
This topic was automatically closed after 7 days. New replies are no longer allowed.