Method GetGuildAsync
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
GetGuildAsync(ulong, bool?, bool, CancellationToken)
Gets a guild.
Setting withCounts to true will make a REST request.
public Task<DiscordGuild> GetGuildAsync(ulong id, bool? withCounts = null, bool fetch = false, CancellationToken cancellationToken = default)
Parameters
idulongThe guild ID to search for.
withCountsbool?Whether to include approximate presence and member counts in the returned guild.
fetchboolWhether to ignore the cache. Defaults to false.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordGuild>
The requested Guild.
Exceptions
- NotFoundException
Thrown when the guild does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.