exclude method

Future<void> exclude({
  1. Duration? duration,
  2. String? reason,
})

Exclude the member.

await member.exclude(duration: Duration(days: 7), reason: 'Testing');

Implementation

Future<void> exclude({Duration? duration, String? reason}) {
  final timeout =
      duration != null ? DateTime.now().add(duration) : DateTime.now();

  return _memberMethods.updateMember(
      serverId: server.id,
      memberId: id,
      reason: reason,
      payload: {'communication_disabled_until': timeout.toIso8601String()});
}