I'm trying to do a bot to verify members on a special guild.
They need to send "verify"
into a specific channel, then they have to answer several questions. However, the collector doesn't seem to work properly. Nothing shows in console.
client.on('messageCreate', async message => {
if(message.author.id === botId) return;
if(message.channel.type != "dm") {
if(message.channelId == verifyChannelId && message.content == "verify") {
let appChannel = (await message.author.send('Hello, I\'m gonna asking you a few questions..')).channel;
appChannel.send('Are you on european server? (Yes/No)');
const filter = m => (appChannel.type === "dm");
const collector = appChannel.createMessageCollector({ filter, time: 15000 });
collector.on('collect', m => {
console.log(`Collected ${m.content}`);
});
collector.on('end', collected => {
console.log(`Collected ${collected.size} items`);
});
message.delete({ timeout: 1000 });
} else {
message.delete({ timeout: 1000 });
}
}
});