FluxpointDev / RevoltSharp

A C# lib for using the revolt chat API and connecting to the gateway to get events.
https://rvlt.gg/N33Rf6DE
MIT License
17 stars 3 forks source link

Added additional checks on null values coming back in UserUpdate payload #27

Closed MattTheDev closed 4 months ago

MattTheDev commented 4 months ago

When trying to update the bot users status, I was receiving the following errors in my output:

image

When receiving this error, the bot would continue to function but the update of the bot users status didn't complete.

Running the TestBot, I was able to isolate the issue to this line of code:

ProfileContent = json.Profile.Value.Content;

Once wrapped in checks to ensure data was what we needed to see before assigning values, the users status message was successfully set AND the bot continued to function without issue.