Method CreateInviteAsync
- Namespace
- DisCatSharp.Entities
- Assembly
- DisCatSharp.dll
CreateInviteAsync(int, int, bool, bool, TargetType?, ulong?, ulong?, string)
Create a new invite object
public Task<DiscordInvite> CreateInviteAsync(int maxAge = 86400, int maxUses = 0, bool temporary = false, bool unique = false, TargetType? targetType = null, ulong? targetApplicationId = null, ulong? targetUser = null, string reason = null)
Parameters
maxAgeintDuration of invite in seconds before expiry, or 0 for never. Defaults to 86400.
maxUsesintMax number of uses or 0 for unlimited. Defaults to 0
temporaryboolWhether this invite should be temporary. Defaults to false.
uniqueboolWhether this invite should be unique. Defaults to false.
targetTypeTargetType?The target type. Defaults to null.
targetApplicationIdulong?The target activity ID. Defaults to null.
targetUserulong?The target user id. Defaults to null.
reasonstringThe audit log reason.
Returns
Exceptions
- UnauthorizedException
Thrown when the client does not have the CreateInstantInvite permission.
- NotFoundException
Thrown when the channel does not exist.
- BadRequestException
Thrown when an invalid parameter was provided.
- ServerErrorException
Thrown when Discord is unable to process the request.