1client.on('message', message => {
2 // this function can check whether the content of the message you pass is the same as this message
3 let filter = msg => {
4 return msg.content.toLowerCase() == message.content.toLowerCase() && // check if the content is the same (sort of)
5 msg.author == message.author; // check if the author is the same
6 }
7
8 message.channel.awaitMessages(filter, {
9 maxMatches: 1, // you only need that to happen once
10 time: 5 * 1000 // time is in milliseconds
11 }).then(collected => {
12 // this function will be called when a message matches you filter
13 }).catch(console.error);
14});