qeled / discordie

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

PRESENCE_UPDATE fires multiple times #67

Closed Edsardio closed 7 years ago

Edsardio commented 7 years ago

On updating status from online to invisible the event gets fired once, updating from online to do not disturb fires 3 times. (That's what I logged as last) Changing the game fires twice or more as well. How to fix this?

qeled commented 7 years ago

Presences are per-guild - it fires a presence for each shared guild with your bot. This is how the API works.

You can compare previousStatus, previousGameName, and/or simply throw away presences for guilds you don't want to process.