Uncaught TypeError: arr.includes is not a function
bot.on('message', message =>{
if(message.content === "refresh"){
let arr = [];
message.guild.members.cache.forEach(u => arr.push(arr.id))
console.log("БД обновлена");
}
})
//Сам анон чат
bot.on('message', message => {
if(message.author === bot.user) return;
if(message.content.startsWith('/') && message.channel.type == "dm") {
if (arr.includes(message.author) === true) {
message.content = message.content.replace("/","")
hook.send(message.content);
console.log(message.author + " сказал " + '"' + message.content + '"')
} else {
message.send("Вы должны быть присоеденены к серверу")
}
}
});
client.on('message', async message => {
// Voice only works in guilds, if the message does not come from a guild,
// we ignore it
if (!message.guild) return;
if (message.content === '++join') {
// Only try to join the sender's voice channel if they are in one themselves
if (message.member.voiceChannel) {
const connection = await message.member.voice.channel.join();
const dispatcher = connection.play(ytdl('https://www.youtube.com/watch?v=ZlAU_w7-Xp8', { quality: 'highestaudio' }));
dispatcher.on('start', () => {
message.member.channel.send('audio.mp3 проигрывается!');
});
dispatcher.on('finish', () => {
message.channel.send('audio.mp3 остановлено!');
});
dispatcher.on('error', console.error);
} else {
message.reply('You need to join a voice channel first!');
}
}
});