Discord normally sends guild id as a long, but occasionally sends it as a String. This is the case when Discord notifies of a pinned or unpinned message, and perhaps for other events.
Reproduction Steps
Steps to reproduce the behavior:
have the bot observe a "message pinned" or "message unpinned" event
observe error logs
Expected behaviorGatwayEventListener::getGuild should use branching logic to successfully deserialize guild id via reflection regardless of whether it arrives as a String or a long
Acceptance Criteria
WHEN the bot receives an event payload with guild id as a String or a long
THENGatewayEventListener::getGuild should successfully deserialize guild id
Description of the Issue
Discord normally sends guild id as a long, but occasionally sends it as a String. This is the case when Discord notifies of a pinned or unpinned message, and perhaps for other events.
Reproduction Steps
Steps to reproduce the behavior:
Expected behavior
GatwayEventListener::getGuild
should use branching logic to successfully deserialize guild id via reflection regardless of whether it arrives as a String or a longAcceptance Criteria
WHEN the bot receives an event payload with guild id as a String or a long THEN
GatewayEventListener::getGuild
should successfully deserialize guild id