Table of Contents

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 request
public IAsyncEnumerable<DiscordGuild> GetGuildsAsync(int limit = 200, bool? withCount = null, CancellationToken cancellationToken = default)

Parameters

limit int
withCount 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.