API reference
Method GetCurrentUserGuildsAsync
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
GetCurrentUserGuildsAsync(int?, int, ulong?, ulong?, CancellationToken)
Gets a page of the current bot's guilds through the HTTP API.
public Task<IReadOnlyList<DiscordGuild>> GetCurrentUserGuildsAsync(int? shard = null, int limit = 100, ulong? before = null, ulong? after = null, CancellationToken cancellationToken = default)
Parameters
shardint?The large-bot guild-list shard, distinct from a gateway shard ID. Required by Discord for large-bot sharding.
limitintMaximum number of guilds returned, from 1 through 200.
beforeulong?Return guilds before this ID.
afterulong?Return guilds after this ID.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<IReadOnlyList<DiscordGuild>>
Cached guilds where available, otherwise partial guild objects returned by Discord.