GetNextMessageAsync returns null Results
See original GitHub issueSummary
After using the MessageExtension.GetNextMessageAsync
method (with or without parameters) on a DiscordMessage
object, accessing the returned Results
property causes NullReferenceException
.
Details
The length of time it took for the NRE to occur from the point GetNextMessageAsync
is called is equivalent to the time specified in the interactivity configuration timeout. The NRE occurs even if you haven’t sent anything into the respective channel.
Steps to reproduce
- Send a message into a channel,
- Use the
GetNextMessageAsync
method on the message object, - Enter a random word,
- Try to access the
Results
property and it should be null.
Issue Analytics
- State:
- Created a year ago
- Comments:5 (3 by maintainers)
Top Results From Across the Web
Async response to onMessage returns null - javascript
I am trying to get an asyc response with the chrome messaging system but it always returns the literal value null .
Read more >getSession always returns null on server #1466
Hey community! I'm trying to get the user's session on server side in order to render the correct page (login or dashboard) from...
Read more >[Solved] Null return value from a async function
If I use function lsinfo() without async the code works fine but info['_myip'] return null. The async keyword does nothing in your context ......
Read more >Returning null from Task-returning methods in C#
In this blog post, we'll understand this behavior and the difference between returning null from an async vs. non- async method in C#....
Read more >Async return types (C#)
Returning a Task enables WaitAndApologizeAsync to be awaited. The Task type doesn't include a Result property because it has no return value ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Confirmed bug, not because of the NRE but because GetNextMessageAsync isn’t properly getting the next message causing the method to timeout (as seen in
InteractivityResult<DiscordMessage>.TimedOut
). Here’s a repro:Unofficially assigning @DWaffles if they wish to take up the issue
It’s the timing out that is the issue, the code never gets executed. At least it didn’t when I was debugging it and trying to find the exact source. @OoLunar mentioned this in a above post too.
Dec 5, 2022 6:12:11 PM Velvet @.***>: