Skip to content

Commit

Permalink
🚶🏻‍➡️ Removal of executed handlers
Browse files Browse the repository at this point in the history
  • Loading branch information
HeySreelal committed Apr 16, 2024
1 parent ce6e17b commit 1709f95
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/src/televerse/bot.dart
Original file line number Diff line number Diff line change
Expand Up @@ -349,7 +349,12 @@ class Bot {
if (!passing) continue;
_preProcess(sub[forks[i]], context);
await _processUpdate(sub[forks[i]], context);
sub.removeAt(forks[i]);
}

// Once completed, remove the forked handlers in the decending order.
forks.sort((a, b) => b.compareTo(a));
for (final i in forks) {
sub.removeAt(i);
}

// Finds and processes the handler scopes.
Expand Down

0 comments on commit 1709f95

Please sign in to comment.