Advertisement
DjKammo

Untitled

Jan 25th, 2022
1,263
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. msg.react('👍').then(() => msg.react('👎'));
  2.  
  3. const filter = (reaction, user) => {
  4.     return ['👍', '👎'].includes(reaction.emoji.name) && user.id === interaction.user.id;
  5. };
  6.  
  7. msg.awaitReactions({ filter, max: 1, time: 40000, errors: ['time'] })
  8.     .then(collected => {
  9.         const reaction = collected.first();
  10.  
  11.         if (reaction.emoji.name === '👍') {
  12.             msg.reply('You reacted with a thumbs up.');
  13.         } else {
  14.             msg.reply('You reacted with a thumbs down.');
  15.         }
  16.     })
  17.     .catch(collected => {
  18.         msg.reply('You reacted with neither a thumbs up, nor a thumbs down.');
  19.     });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement