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

Implement auto moderation #1220

Open
wants to merge 11 commits into
base: master
Choose a base branch
from

Conversation

FasterSpeeding
Copy link
Collaborator

@FasterSpeeding FasterSpeeding commented Jul 18, 2022

Summary

Checklist

  • I have run nox and all the pipelines have passed.
  • I have made unittests according to the code I have added/modified/deleted.

Related issues

Closes #1189

Copy link
Contributor

@thomm-o thomm-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

😄

hikari/api/rest.py Outdated Show resolved Hide resolved
hikari/api/rest.py Outdated Show resolved Hide resolved
hikari/api/rest.py Outdated Show resolved Hide resolved
hikari/api/rest.py Outdated Show resolved Hide resolved
hikari/auto_mod.py Outdated Show resolved Hide resolved
hikari/api/event_factory.py Outdated Show resolved Hide resolved
hikari/api/event_factory.py Outdated Show resolved Hide resolved
hikari/api/event_factory.py Outdated Show resolved Hide resolved
hikari/api/event_factory.py Outdated Show resolved Hide resolved
hikari/events/auto_mod_events.py Show resolved Hide resolved
hikari/api/rest.py Show resolved Hide resolved
hikari/api/rest.py Show resolved Hide resolved
hikari/api/rest.py Show resolved Hide resolved
hikari/api/rest.py Outdated Show resolved Hide resolved
hikari/api/rest.py Outdated Show resolved Hide resolved
@GoogleGenius
Copy link
Contributor

This closes #1189

@davfsa davfsa added the enhancement New feature or request label Jul 19, 2022
class PartialAutoModTrigger:
"""Base class representing the content a rule triggers on."""

type: AutoModTriggerType = attr.field(eq=False, hash=False, repr=False)
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add defaults for this or just have it be static per-sub-class

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If we never actually get this class in the real world, this could be made abstract and then specify in each subclass

hikari/__init__.py Show resolved Hide resolved
hikari/api/entity_factory.py Show resolved Hide resolved
presets: undefined.UndefinedOr[
typing.Sequence[typing.Union[int, auto_mod.AutoModKeywordPresetType]]
] = undefined.UNDEFINED,
enabled: undefined.UndefinedOr[bool] = True,
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would be better UX to take subclasses of PartialAutoModTrigger here instead of their config fields but that'd add complexity impl wise and idk if you want to keep these functions as flat as possible or not

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since this didn't really get any comment i'ma just switch to that approach

@GoogleGenius
Copy link
Contributor

AUTO_MODERATION_RULE_CREATE = 140
AUTO_MODERATION_RULE_UPDATE = 141
AUTO_MODERATION_RULE_DELETE = 142
AUTO_MODERATION_BLOCK_MESSAGE = 143

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
AUTO_MODERATION_FLAG_TO_CHANNEL = 144
AUTO_MODERATION_USER_COMMUNICATION_DISABLED = 145

@davfsa
Copy link
Member

davfsa commented Jan 21, 2024

Apart from a rebase and failing tests, what still needs to be done on this pr?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement AutoMod
5 participants