Table of Contents

Method TryGetMessageAsync

Namespace
DisCatSharp.Entities
Assembly
DisCatSharp.dll

TryGetMessageAsync(ulong, bool)

Tries to get a specific message.

public Task<DiscordMessage?> TryGetMessageAsync(ulong id, bool fetch = true)

Parameters

id ulong

The id of the message

fetch bool

Whether to bypass the cache. Defaults to true.

Returns

Task<DiscordMessage>

Exceptions

UnauthorizedException

Thrown when the client does not have the ReadMessageHistory permission.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.