Table of Contents

Method GetInviteByCodeAsync

Namespace
DSharpPlus
Assembly
DSharpPlus.dll

GetInviteByCodeAsync(string, bool?)

Gets an invite.

public Task<DiscordInvite> GetInviteByCodeAsync(string code, bool? withCounts = null)

Parameters

code string

The invite code.

withCounts bool?

Whether to include presence and total member counts in the returned invite.

Returns

Task<DiscordInvite>

The requested Invite.

Exceptions

NotFoundException

Thrown when the invite does not exists.

BadRequestException

Thrown when an invalid parameter was provided.

ServerErrorException

Thrown when Discord is unable to process the request.