Method GetInviteByCodeAsync
- Namespace
- DSharpPlus
- Assembly
- DSharpPlus.dll
GetInviteByCodeAsync(string, bool?, bool?)
Gets an invite.
public Task<DiscordInvite> GetInviteByCodeAsync(string code, bool? withCounts = null, bool? withExpiration = null)
Parameters
code
stringThe invite code.
withCounts
bool?Whether to include presence and total member counts in the returned invite.
withExpiration
bool?Whether to include the expiration date 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.