javadiscord / java-discord-api

A wrapper over the discord API to create bots using Java
GNU General Public License v3.0
7 stars 8 forks source link

`GatewayEventListener::getGuild` fails to deserialize guild id when the id comes as a String from Discord #104

Closed NightTripperID closed 4 months ago

NightTripperID commented 4 months ago

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 long

Acceptance 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

SquidXTV commented 4 months ago

fixed by #108