createInvite abstract method

Future<IInvite> createInvite(
  1. {int? maxAge,
  2. int? maxUses,
  3. bool? temporary,
  4. bool? unique,
  5. String? auditReason}
)

Creates new IInvite for IChannel and returns it's instance.

Requires the PermissionsConstants.createInstantInvite permission.

maxAge in seconds can be between 0 and 604800 (7 days). If set to 0, the invite will never expire. The default is 24 hours.

maxUses can be between 0 and 100. If set to 0, the invite will have unlimited uses. The default is 0 (unlimited).

temporary determines whether this invite only grants temporary membership.

If unique is true, Discord won't try to reuse a similar invite and will instead always generate a new invite in the request.

var invite = await channel.createInvite(maxUses: 100);

Implementation

Future<IInvite> createInvite({int? maxAge, int? maxUses, bool? temporary, bool? unique, String? auditReason});