Commit fd4ba5e
feat: Auto Moderation (#7938)
* feat: initial AutoMod commit
* types: Typo in class name
Co-authored-by: Jonathan <54381371+axisiscool@users.noreply.github.com>
* refactor: move things around
* refactor: remove undocumented property
* chore: add new intents to issue form
* feat: add initial basic manager
* feat(AutoModRule): add new properties
* feat: add events
* feat(GuildAuditLog): cache rules
* refactor: move JSDoc to where it is actually used
* refactor(AutoModRule): add `_patch()` method
* feat(AutoModRuleManager): add resolvers
* feat(Sweepers): add new manager
* types: nullify first parameter of `autoModerationRuleUpdate`
* types: add manager to `Caches`
* docs(AutoModRule): update `metadata` docstring
* feat: add execution event
* fix(AutoModActionExecution): export class
* refactor(AutoModRule): `triggerType` is not modifiable
* docs(AutoModRule): link class
* feat: add trigger metadata definitions
* docs(AutoModRule): typos
* feat(AutoModRule): action metadata
* types: Proper casing of name
Co-authored-by: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com>
* refactor: only patch data if exists
* types: `preset` is an array
* types(AutoModRuleActionMetadata): nullify all
* feat(AutoModRuleManager): add `fetch()`
* docs(AutoModRule): tweak some wording
* docs(AutoModRule): use "array" over "list"
* docs(AutoModRuleResolvable): fix union
* types: adjust some names
* feat(AutoModRuleManager): add `create()`
* feat(AutoModRuleManager): add `delete()`
* refactor: prefer full auto moderation name
* docs(AutoModerationRuleManager): fix a fetch example
* refactor(Sweepers): alphabetise methods
* chore: remove testing
* fix(AutoModerationRuleCreateOptions): add `reason`
* fix: typo for `presets`
* fix(AutoModerationRuleCreateOptions): `actions` is required
* fix(AutoModerationRuleManager): handle properties that are unrequired
* feat(AutoModerationRuleManager): add `edit()`
* feat(GuildAuditLogsEntry): add auto moderation rules
* refactor: prefer "AutoModerationActionExecutionAction"
* refactor: annotate todos and doc fixes
* feat(AutoModerationRule): add guild getter
* docs(AutoModerationRule): rule -> auto moderation rule
* docs(AutoModerationRuleEditOptions): `eventType` is optional
* feat(AutoModerationRule): add helpers
* docs: random string updates
* chore: add TODOs
* feat(AutoModerationActionExecution): add helpers
* feat: support role and channel resolvables
* chore: high priority todo to keep me in solitary
* refactor(AutoModerationActionMetadataOptions): allow resolvables
* chore: tidy up from merge
* docs(AutoModerationRule): document extension
* feat: export `AutoModerationRuleManager`
* chore(ActionsManager): add new actions
* chore: add to websocket index
* refactor(AutoModerationActionExecution): send the guild across
* docs(AutoModerationActionExecution): typo
* docs(AutoModerationRule): deduplicate a word
* docs(Guild): dot
* test: add some basic tests
* docs(AutoModerationRuleManager): fetch is optional
* docs(AutoModerationActionExecution): prefer non-links
* types: `presets` is an array of numbers
* docs(AutoModerationRuleEditOptions): `name` is optional
* docs(AutoModerationRule): fix type for `exemptChannels`
* docs(AutoModerationRuleUpdateAction): remove "object"
* feat: add `allow_list`
* fix(GuildAuditLogsEntry): pass guild
* docs(AutoModerationRuleManager): correct fetch example
* chore: prettier
* refactor: remove unneeded optional chaining operator
* feat: add mention limit
* docs(AutoModerationRuleManager): document new requirement
* refactor: conform to message content intent
* docs: document permission for event
* docs: refactor intent message
* docs: dot
* docs: remove string in link
* refactor: document upstream changes
* fix(AutoModerationRuleDelete): Correct event fire
Co-authored-by: GoldenAngel <50855202+GoldenAngel2@users.noreply.github.com>
* feat(AutoModerationRule): Add `setMentionTotalLimit()` helper method
* feat(AuditLogEntries): add new extra fields
* types: add `guild` in constructors
* types: update typings
* refactor(AutoModerationRuleManager): `&&` shorthand
* types: remove leftover type
* chore: types
* docs: update API types
* docs: Tweak guild wording
Co-authored-by: Aura Román <kyradiscord@gmail.com>
* feat: add regular expression matching
* docs: update `allowList` wording
* refactor: deduplicate `guildId`
Co-authored-by: Jonathan <54381371+axisiscool@users.noreply.github.com>
Co-authored-by: MateoDeveloper <79017590+Mateo-tem@users.noreply.github.com>
Co-authored-by: GoldenAngel <50855202+GoldenAngel2@users.noreply.github.com>
Co-authored-by: Aura Román <kyradiscord@gmail.com>1 parent 153d240 commit fd4ba5e
File tree
24 files changed
+1072
-3
lines changed- .github/ISSUE_TEMPLATE
- packages/discord.js
- src
- client
- actions
- websocket/handlers
- managers
- structures
- util
- typings
24 files changed
+1072
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
132 | 132 | | |
133 | 133 | | |
134 | 134 | | |
| 135 | + | |
| 136 | + | |
135 | 137 | | |
136 | 138 | | |
137 | 139 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
8 | 12 | | |
9 | 13 | | |
10 | 14 | | |
| |||
Lines changed: 26 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
Lines changed: 27 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
Lines changed: 29 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
Lines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
0 commit comments