Method GetGuildsAsync
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
GetGuildsAsync(int, bool?, CancellationToken)
Returns a list of guilds the bot is in. This will execute one API request per 200 guilds.
The amount of guilds to fetch.Whether to include approximate member and presence counts in the returned guilds.Cancels the enumeration before doing the next api requestpublic IAsyncEnumerable<DiscordGuild> GetGuildsAsync(int limit = 200, bool? withCount = null, CancellationToken cancellationToken = default)
Parameters
limit
intwithCount
bool?cancellationToken
CancellationToken
Returns
- IAsyncEnumerable<DiscordGuild>
Exceptions
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.