Skip to content

Use custom clean cog when purge banning#2033

Merged
ChrisLovering merged 9 commits into
mainfrom
purge-to-clean
Feb 16, 2022
Merged

Use custom clean cog when purge banning#2033
ChrisLovering merged 9 commits into
mainfrom
purge-to-clean

Conversation

@ChrisLovering
Copy link
Copy Markdown
Member

This PR migrates our purgeban command away from Discord's native purgeban in favour of our custom logic.

Discord's native purgeban does not leave us with any evidence or context of what messages were deleted. So when mods reference the infraction at a later date, as example for an appeal, they are lacking required information.

Instead, we can use our custom clean cog to delete all messages from the user in question for the last hour, and automatically append the link to that clean log to the infraction reason.

@ChrisLovering ChrisLovering force-pushed the purge-to-clean branch 2 times, most recently from e9313a6 to fd3bfc7 Compare December 31, 2021 18:26
@ChrisLovering ChrisLovering added a: moderation Related to community moderation functionality: (moderation, defcon, verification) p: 2 - normal Normal Priority s: needs review Author is waiting for someone to review and approve t: enhancement Changes or improvements to existing features labels Dec 31, 2021
@ChrisLovering
Copy link
Copy Markdown
Member Author

ChrisLovering commented Dec 31, 2021

Since this changeset introduces additional cross-cog dependencies, that could be unintentionally broken, I'm planning on writing some tests for this new behaviour. Will get around to it later this evening/tomorrow.

@ChrisLovering ChrisLovering force-pushed the purge-to-clean branch 2 times, most recently from 268fb63 to a026dec Compare December 31, 2021 18:58
@ChrisLovering ChrisLovering changed the title Purge to clean Use custom clean cog when purge banning Dec 31, 2021
@onerandomusername
Copy link
Copy Markdown
Contributor

Since this changeset introduces additional cross-cog dependencies, that could be unintentionally broken, I'm planning on writing some tests for this new behaviour. Will get around to it later this evening/tomorrow.

There are some aditional bugs with undefined behavior related to this, depending on how they are implemented.

Please check #2022 (comment) for more information.
(Also, Happy new year!)

@ChrisLovering
Copy link
Copy Markdown
Member Author

Since this changeset introduces additional cross-cog dependencies, that could be unintentionally broken, I'm planning on writing some tests for this new behaviour. Will get around to it later this evening/tomorrow.

There are some aditional bugs with undefined behavior related to this, depending on how they are implemented.

Please check #2022 (comment) for more information.
(Also, Happy new year!)

I'm only importing for type checking, so I dont follow how that applies for this case?

Copy link
Copy Markdown
Contributor

@jchristgit jchristgit left a comment

Choose a reason for hiding this comment

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

LGTM

@ChrisLovering ChrisLovering force-pushed the purge-to-clean branch 4 times, most recently from dfee235 to 536a4ea Compare February 14, 2022 01:24
Comment thread bot/exts/moderation/infraction/infractions.py Outdated
Comment thread bot/exts/moderation/infraction/infractions.py
Comment thread bot/exts/moderation/infraction/infractions.py Outdated
Comment thread tests/bot/exts/moderation/infraction/test_infractions.py
Comment thread tests/bot/exts/moderation/test_clean.py Outdated
ChrisLovering and others added 6 commits February 16, 2022 22:12
This migrates the purgeban command away from Discord's native purgeban to our custom logic.

Discord's native purgeban does not leave us with any evidence or context of what messages were deleted. So when mods reference the infraction at  a later date they are lacking information.

Instead, we use our custom clean cog to delete all messages from the user in question for the last hour, and automatically append the link to the clean log to the infraction reason.

.
Co-authored-by: GDWR <gregory.dwr@gmail.com>
Co-authored-by: GDWR <gregory.dwr@gmail.com>
@ChrisLovering ChrisLovering merged commit 674391b into main Feb 16, 2022
@ChrisLovering ChrisLovering deleted the purge-to-clean branch February 16, 2022 22:19
@Xithrius Xithrius removed the s: needs review Author is waiting for someone to review and approve label Feb 20, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: moderation Related to community moderation functionality: (moderation, defcon, verification) p: 2 - normal Normal Priority t: enhancement Changes or improvements to existing features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants