Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support regex automod #794

Merged
merged 5 commits into from
Nov 4, 2022
Merged

feat: support regex automod #794

merged 5 commits into from
Nov 4, 2022

Conversation

onerandomusername
Copy link
Member

@onerandomusername onerandomusername commented Oct 7, 2022

Summary

implements discord/discord-api-docs#5504

This has been tested in a private server.

Checklist

  • If code changes were made, then they have been tested
    • I have updated the documentation to reflect the changes
    • I have formatted the code properly by running task lint
    • I have type-checked the code by running task pyright
  • This PR fixes an issue
  • This PR adds something new (e.g. new method or parameters)
  • This PR is a breaking change (e.g. methods or parameters removed/renamed)
  • This PR is not a code change (e.g. documentation, README, ...)

@onerandomusername onerandomusername added t: enhancement New feature s: waiting for api/docs Issue/PR is waiting for API support/documentation labels Oct 7, 2022
@onerandomusername onerandomusername added this to the disnake v2.7 milestone Oct 7, 2022
disnake/automod.py Outdated Show resolved Hide resolved
disnake/automod.py Outdated Show resolved Hide resolved
disnake/automod.py Outdated Show resolved Hide resolved
changelog/794.feature.rst Outdated Show resolved Hide resolved
@shiftinv
Copy link
Member

shiftinv commented Oct 8, 2022

The documentation for AutoModActionExecution.matched_keyword should mention regular expressions as well, looks like that field is being reused:

{
    "t": "AUTO_MODERATION_ACTION_EXECUTION",
    "s": 12,
    "op": 0,
    "d": {
        "user_id": "",
        "rule_trigger_type": 1,
        "rule_id": "984891789930557500",
        "matched_keyword": "literally 1\\s*9\\s*8\\s*4",
        "matched_content": "literally 1 9 8 4",
        "content": "wow this is literally 1 9 8 4 smh",
        ...
    }
}

@onerandomusername
Copy link
Member Author

@shiftinv I added a mention of matched_keyword possibly containing regex in 5805f24

disnake/automod.py Outdated Show resolved Hide resolved
onerandomusername and others added 4 commits November 3, 2022 16:39
Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com>
Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: arl <me@arielle.codes>
disnake/automod.py Outdated Show resolved Hide resolved
disnake/automod.py Show resolved Hide resolved
@onerandomusername onerandomusername marked this pull request as ready for review November 4, 2022 21:55
@onerandomusername onerandomusername removed the s: waiting for api/docs Issue/PR is waiting for API support/documentation label Nov 4, 2022
Co-authored-by: shiftinv <8530778+shiftinv@users.noreply.github.com>
Signed-off-by: arl <me@arielle.codes>
@onerandomusername onerandomusername merged commit af8bedd into master Nov 4, 2022
@onerandomusername onerandomusername deleted the feat/regex-automod branch November 4, 2022 22:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
t: enhancement New feature
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

2 participants