local_spam_guard 0.1.0
local_spam_guard: ^0.1.0 copied to clipboard
Offline chat spam detection for Dart and Flutter with flooding, repetition, link, and formatting protection.
example/local_spam_guard_example.dart
import 'package:local_spam_guard/local_spam_guard.dart';
void main() {
final guard = LocalSpamGuard();
final result = guard.check(senderId: 'peer-public-key', text: 'Hello!');
switch (result.action) {
case SpamAction.allow:
print('Display message');
case SpamAction.filter:
print('Message filtered: ${result.reasons}');
case SpamAction.suspend:
print('Peer temporarily suspended locally');
}
guard.strength = SpamFilterStrength.intense;
}