Hej mam problem z napisaniem prostej komendy do bota na napisanie hej poniewaz gdy pisze ja na czacie w konsoli wyskakuje cos takiego i czy mogl by mi ktos pomoc
(node:9540) DeprecationWarning: The message event is deprecated. Use messageCreate instead
(Use `node --trace-deprecation ...` to show where the warning was created)
Mój Kod (jak cos to tam token jest ale go usunolem tera zeby tu wyslac):
const Discord = require ('discord.js')
const bot = new Discord.Client({
intents: [
Discord.Intents.FLAGS.GUILDS,
Discord.Intents.FLAGS.GUILD_MESSAGES
]
});
bot.on('ready', () => {
console.log('Bot online')
})
bot.on('message', (message) => {
if(message.author.bot) return;
if(message.channel.type !== 'text') return;
let prefix = '!';
// hello there ['hello', 'there']
// !ban user reason ['user', 'reason']
// hello
let MessageArray = message.content.split(' ');
let cmd = MessageArray[0].slice(prefix.length)
let args = MessageArray.slice(1)
if(!message.content.startsWitch(prefix)) return;
if(cmd == 'hello') {
message.channel.send('hello');
}
})
bot.login("TOKEN")