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.

Channel.GetMessage 404

See original GitHub issue

If you try to get a message that has previously been deleted, but you have a stored ID for it, the Channel.GetMessage(ulong id); method will crash and as far as i can tell swallow the exception.

I’m not entirely sure that this is true, since i’m executing the Channel.GetMessage(...); function inside of the DiscordClient.LoggedIn event, and i cannot get anything from the exception details due to the Exception occuring in a Task

The stacktrace i’m getting when using the DiscordConfigBuilder.LogHandler event

Discord.Net.HttpException: The server responded with error 404 (NotFound)
   at Discord.Net.Rest.RestSharpEngine.<Send>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Discord.Net.Rest.RestClient.<Send>d__26.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Discord.Net.Rest.RestClient.<Send>d__22`1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1.ConfiguredTaskAwaiter.GetResult()
   at Discord.Net.MessageQueue.<>c__DisplayClass19_0.<<RunEditQueue>b__0>d.MoveNext()

When trying to debug where the Exception even comes from, it leads to DiscordClient.ExecuteAndWait, but encapsulating the contents of the Action in a Try { } Catch(...) { } doesn’t really present any new details.

tl;dr: It appears Channel.GetMessage() swallows an exception and i want to be able to get it, or have null returned so that i can delete the stored message id from storage so that i don’t get errors every time it tries to access a dead message id.

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Comments:6 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
Auralyticalcommented, Mar 14, 2016

To clarify - this was part of a temporary workaround to deal with some issues related to the MessageQueue. GetMessage() in 1.0 will return null if a message doesn’t exist, as it used to pre-0.9.

0reactions
foxbotcommented, Mar 14, 2016

This logic is currently being implemented into 1.0, see the /ref/ project on dev.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Channel.GetMessage 404 · Issue #41 · discord-net ...
If you try to get a message that has previously been deleted, but you have a stored ID for it, the Channel.GetMessage(ulong id);...
Read more >
404: Unknown Message (Discord.py v0.16.12)
The error means that either the channel or the message was not found. It would be helpful to see how you are defining...
Read more >
New Airtable Record to Discord Message - Status Code 404
A 404 error means that whichever record you are attempting to access or update in the API is missing or doesn't exist. Please...
Read more >
Why are the 404 labelled channels not coming up with my ...
Here is my link to my project, and for some reason, the channels that the project labels as "nonexistent" are breaking the api...
Read more >
$message in abort(404) does not show
Hi, PHP version: 7.4.30 Laravel version: 8.83.23 Any idea why I get "404 | NOT FOUND" even though I called abort(404, "Sorry")?
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