Commit d687402
authored
feat: add spam detection event and cache handling command (#3)
* π feat: expand client intents for moderation
* π feat: add message utils
* π feat: add time constants for easier time calculations
* π feat: add spam detection channel and role IDs to environment configuration
* π feat: implement spam detection utilities for message filtering
* π feat: implement MessageCache with LRU eviction and message management
* π feat: add logging functionality for spam detection events
* π¨ refactor: fix typo contants -> constants
* π feat: implement action handlers for spam detection with message deletion and user muting
* π¨ refactor: remove console log from default log function
* π¨ refactor(app): update high frequency action to not delete messages and set mute duration to 30 minutes
* π feat: add rules configuration for spam detection
* π feat: add MAX_RULE_TIMEFRAME constant for spam detection rules
* π feat: implement checkRules and checkRule functions for spam detection
* π feat: add messages cache command with stats, clear, and remove expired options
* π feat: implement spam detection event for message creation
* π feat: add spam detection event to the events list
* π feat: add messagesCacheCommand to the commands list
* π feat: add permission checks for messages cache command execution
* π¨ refactor: update swap function parameter names for clarity
* π¨ refactor: change variable name in getUserMessages filter from msg -> message
* π¨ refactor: rename variable msg -> message
* π¨ refactor: use a function block instead of 1 line return in createStatComponent function
* π¨ refactor: remove WEEK and MONTH constants
* π¨ refactor: rename variable msg to message for consistency
* π¨ refactor: rename variable msg to message for consistency
* π feat: add handleSpoilerHackAction and integrate into rules
* π¨ refactor: consolidate role check conditions for clarity
* π¨ refactor: rename messagesMd to logMessagesFormatters for clarity
* π¨ refactor: ename variable msg to message
* π¨ test: add unit tests for stripCode, stripEmoji, and replaceSpoilerHack functions1 parent 6ab78ab commit d687402
20 files changed
Lines changed: 1050 additions & 4 deletions
File tree
- .github/workflows
- src
- cache
- commands
- messages-cache
- constants
- events
- spam-detection
- utils
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| 9 | + | |
| 10 | + | |
9 | 11 | | |
10 | 12 | | |
11 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
83 | 83 | | |
84 | 84 | | |
85 | 85 | | |
| 86 | + | |
| 87 | + | |
86 | 88 | | |
87 | 89 | | |
88 | 90 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| 44 | + | |
| 45 | + | |
44 | 46 | | |
45 | 47 | | |
46 | 48 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
0 commit comments