Fix invoking reaction events twice

This commit is contained in:
Christopher F
2016-11-05 22:23:01 -05:00
parent 718560917c
commit 676fbbcd23

View File

@@ -1318,6 +1318,7 @@ namespace Discord.WebSocket
{ {
cachedMsg.AddReaction(reaction); cachedMsg.AddReaction(reaction);
await _reactionAddedEvent.InvokeAsync(data.MessageId, cachedMsg, reaction).ConfigureAwait(false); await _reactionAddedEvent.InvokeAsync(data.MessageId, cachedMsg, reaction).ConfigureAwait(false);
return;
} }
await _reactionAddedEvent.InvokeAsync(data.MessageId, Optional.Create<SocketUserMessage>(), reaction).ConfigureAwait(false); await _reactionAddedEvent.InvokeAsync(data.MessageId, Optional.Create<SocketUserMessage>(), reaction).ConfigureAwait(false);
} }
@@ -1342,6 +1343,7 @@ namespace Discord.WebSocket
{ {
cachedMsg.RemoveReaction(reaction); cachedMsg.RemoveReaction(reaction);
await _reactionRemovedEvent.InvokeAsync(data.MessageId, cachedMsg, reaction).ConfigureAwait(false); await _reactionRemovedEvent.InvokeAsync(data.MessageId, cachedMsg, reaction).ConfigureAwait(false);
return;
} }
await _reactionRemovedEvent.InvokeAsync(data.MessageId, Optional.Create<SocketUserMessage>(), reaction).ConfigureAwait(false); await _reactionRemovedEvent.InvokeAsync(data.MessageId, Optional.Create<SocketUserMessage>(), reaction).ConfigureAwait(false);
} }