clearMailbox function

Future<void> clearMailbox(
  1. String agentName, {
  2. String? teamName,
})

Clear a teammate's inbox (delete all messages).

Implementation

Future<void> clearMailbox(String agentName, {String? teamName}) async {
  final inboxPath = getInboxPath(agentName, teamName: teamName);
  try {
    await File(inboxPath).writeAsString('[]');
  } on PathNotFoundException {
    return;
  } catch (_) {}
}