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
maxAge
intDuration of invite in seconds before expiry, or 0 for never. Defaults to 86400.
maxUses
intMax number of uses or 0 for unlimited. Defaults to 0
temporary
boolWhether this invite should be temporary. Defaults to false.
unique
boolWhether this invite should be unique. Defaults to false.
targetType
TargetType?The target type. Defaults to null.
targetApplicationId
ulong?The target activity ID. Defaults to null.
targetUser
ulong?The target user id. Defaults to null.
reason
stringThe 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.