The approach for private messages should be the same as channel messages.
// Create a reaction filter that only will collect those three emojis
const filter = (reaction, user) => ['🇮🇹', '🇬🇧', '🤫'].includes(reaction.emoji.name)
// Create reaction collector (message is the message the bot sent).
// The time is the time in milliseconds that the collector should run for
// (i.e. how long the user has to react).
const collector = message.createReactionCollector(filter, {time: 15000})
// Fired when the user reacts
collector.on('collect', (reaction, user) => {
switch (reaction.name) {
case '🇮🇹':
message.reply('you chose Italian!'(
break
case '🇬🇧':
message.reply('you chose English!')
break
case '🤫':
message.reply('you have a secret code!')
}
})
For more information see the Discord.js guide (archive). Note: The guide hasn't been fully updated to v12 so it says that the second parameter on the collector's collect
event is the collector itself, like it was in v11.