[Bug] Inconsistent information in new uncached DiscordMessage
See original GitHub issueSummary
There is an inconsistency between parameters in uncached message. Some parameters initialize themselves even when the library doesn’t have enough information leading to misleading information in the message object.
Details
Using .NET 6, DSharp version 4.1.0 - tested on 4.2 nightly 01060 with same results
Facts:
When initializing uncached message - eg from Event handling of added reaction - the library doesn’t initialize the Message object correctly. When accessing Embed list of such message, the list is returned and empty - making developer believe that there are no embeds attached to that message, even though the library doesn’t have enough info to say so. Other parameters behave correctly - like message content, which is returned as null if not cached. If retreiving same message, but cached, the info is then different. Embed list is correctly occupied.
Expected behaviour: Parameters about which we don’t have information should stay on null
, like already happens with most of them.
Assumptions
Message constructor initializes all list parameters - attachments, embeds, mentioned_users, reactions, stickers… They all seem to initialize always at least with empty list. The bug might not be only with Embeds?
Steps to reproduce
- Create reactionAdd event handler
- Send a message through other bot on discord, which has an embed attached
- Launch the bot
- React to the message
- Embed list is empty (not null, but empty)
- Repeat 2 and 4
- Embed list is occupied
Notes
We can always retreive correct message through await method, but it’s always worth checking if we don’t have enough cached information. This is inconsistency which seems like we do, even though the information is wrong
Issue Analytics
- State:
- Created 2 years ago
- Comments:6 (3 by maintainers)
Top GitHub Comments
Any updates? 😅 It’s actually a lot less urgent with the introduction of #1297 that can be quite effective workaround. (love you @Foxite for that PR ❤️)
What’s the status on this issue? Is anyone willing to try to fix this?