qeled / discordie

Predictable JavaScript abstractions for Discord API.
https://qeled.github.io/discordie/
BSD 2-Clause "Simplified" License
190 stars 45 forks source link

Very long addition of reactions #116

Open hiop opened 6 years ago

hiop commented 6 years ago

Problem

try

client.Dispatcher.on(Events.MESSAGE_CREATE, e => {
     newMessage = client.Messages.get(e.message.id);
     newMessage.addReaction(REACTIONS[DOWN_ACTION]);
     newMessage.addReaction(REACTIONS[RIGHT_ACTION]);
     newMessage.addReaction(REACTIONS[BACK_ACTION]);
     newMessage.addReaction(REACTIONS[LEFT_ACTION]);
});

another try with chain

client.Dispatcher.on(Events.MESSAGE_CREATE, e => {
  var msgid = e.message.id;
   client.Messages.get(msgid).addReaction(REACTIONS[DOWN_ACTION]).then( (result) =>{
          client.Messages.get(msgid).addReaction(REACTIONS[RIGHT_ACTION]).then( (result) => .... )
   })
});

one by one slowly added, maybe there is a way to send all at once? or faster?