SHARE
TWEET

Untitled

a guest May 21st, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. let filter = (reaction, user) => ['new', 'gear', 'x'].includes(reaction.emoji.name) && user.id === message.author.id;
  2.   message.channel.send(embed).then(async msg => {
  3.     await msg.react('🆕');
  4.     await msg.react('⚙');
  5.     await msg.react('❌');
  6.  
  7.     console.log('Waiting');
  8.     await msg.awaitReactions(filter, {
  9.       max: 1,
  10.       time: 30000,
  11.       errors: ['time']
  12.     }).then(collected => {
  13.       console.log('Collected');
  14.       let reaction = collected.first();
  15.  
  16.       switch (reaction.emoji.name) {
  17.         case 'new':
  18.             message.channel.send("I got 1");
  19.           break;
  20.         case 'gear':
  21.             message.channel.send("I got 2");
  22.           break;
  23.         case 'x':
  24.             message.channel.send("I got 3");
  25.           break;
  26.       };
  27.     }).catch(collected => {
  28.       message.channel.send(":x: Error!");
  29.     });
  30.   });
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top