Method GetChannelAsync
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
GetChannelAsync(ulong, bool, CancellationToken)
Gets a channel.
public Task<DiscordChannel> GetChannelAsync(ulong id, bool fetch = false, CancellationToken cancellationToken = default)
Parameters
idulongThe id of the channel to get.
fetchboolWhether to ignore the cache. Defaults to false.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordChannel>
The requested channel.
Exceptions
- NotFoundException
Thrown when the channel does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.