Method GetInviteByCodeAsync
- Namespace
- DisCatSharp
- Assembly
- DisCatSharp.dll
GetInviteByCodeAsync(string, bool?, ulong?, bool?, CancellationToken)
Gets an invite.
public Task<DiscordInvite> GetInviteByCodeAsync(string code, bool? withCounts = null, ulong? scheduledEventId = null, bool? withPermissions = null, CancellationToken cancellationToken = default)
Parameters
codestringThe invite code.
withCountsbool?Whether to include presence and total member counts in the returned invite.
scheduledEventIdulong?The scheduled event id.
withPermissionsbool?Whether to include the invite's permissions.
cancellationTokenCancellationTokenA token to cancel the request.
Returns
- Task<DiscordInvite>
The requested invite.
Exceptions
- NotFoundException
Thrown when the invite does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.