Method TryGetMessageAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
TryGetMessageAsync(ulong, CancellationToken)
Tries to get a previously-sent webhook message.
public Task<DiscordMessage?> TryGetMessageAsync(ulong messageId, CancellationToken cancellationToken = default)
Parameters
messageIdulongThe ID of the message to retrieve.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.
TryGetMessageAsync(ulong, ulong, CancellationToken)
Tries to get a previously-sent webhook message.
public Task<DiscordMessage> TryGetMessageAsync(ulong messageId, ulong threadId, CancellationToken cancellationToken = default)
Parameters
messageIdulongThe ID of the message to retrieve.
threadIdulongThe ID of the thread containing the message.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
Exceptions
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.