question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[Bug] Inconsistent information in new uncached DiscordMessage

See original GitHub issue

Summary

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

  1. Create reactionAdd event handler
  2. Send a message through other bot on discord, which has an embed attached
  3. Launch the bot
  4. React to the message
  5. Embed list is empty (not null, but empty)
  6. Repeat 2 and 4
  7. 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:open
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
stepechcommented, Aug 21, 2022

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 ❤️)

0reactions
OoLunarcommented, Feb 13, 2022

What’s the status on this issue? Is anyone willing to try to fix this?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Discord scrolling back a few messages when opening ...
This only happens when the scroll up bug happens, and it's not consistent. I have tried clearing cache, I have no pending updates....
Read more >
Discord Has Notification but No Message
To do this, close the Discord app completely, open the Run dialog (Windows: Win + R, Mac: Command + Space), type “%appdata%”, and...
Read more >
Cache is not populated when inside on_ready() #4112
I attempted to do this in a discord.Client on_ready() event but every attempt to read the cache for the channel returns None. Fetching...
Read more >
How to Fix the Discord Fatal Javascript Error in Windows ...
The fatal Javascript error often arises because of corrupted Discord cache data. Fortunately, erasing a couple of Discord data folders will ...
Read more >
Can't Login to Discord? Fix Discord login problems
Fix Discord login problems. This post will help you if you are unable to login to Discord with username and password using the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found