[Cleanup] Pass reason for bulk message deletion to audit log #5863

Merged
leetfin merged 7 commits from cleanup-audit-reason into V3/develop 2022-10-12 23:02:38 +02:00
leetfin commented 2022-10-03 18:05:25 +02:00 (Migrated from github.com)

Description of the changes

Fixes #5861

Have the changes in this PR been tested?

No

### Description of the changes Fixes #5861 ### Have the changes in this PR been tested? <!-- Choose one (remove the line that doesn't apply): --> No <!-- If the question doesn't apply (for example, it's not a code change), choose Yes. Please respond to this question truthfully. We do not delay nor reject PRs based on the answer to this question but it allows to better review this PR. -->
Flame442 (Migrated from github.com) reviewed 2022-10-03 18:08:40 +02:00
@ -12,6 +12,8 @@ if TYPE_CHECKING:
async def mass_purge(
Flame442 (Migrated from github.com) commented 2022-10-03 18:08:18 +02:00

The linked issue specified this should be a kwarg, and I do think it would be better as one.

The linked issue specified this should be a kwarg, and I do think it would be better as one.
leetfin (Migrated from github.com) reviewed 2022-10-03 18:11:43 +02:00
@ -12,6 +12,8 @@ if TYPE_CHECKING:
async def mass_purge(
leetfin (Migrated from github.com) commented 2022-10-03 18:11:43 +02:00

Would **reason: str, be the correct way to specify this as a kwarg here?

Would `**reason: str,` be the correct way to specify this as a kwarg here?
Jackenmen (Migrated from github.com) reviewed 2022-10-03 18:12:42 +02:00
@ -12,6 +12,8 @@ if TYPE_CHECKING:
async def mass_purge(
Jackenmen (Migrated from github.com) commented 2022-10-03 18:12:42 +02:00

To make something a keyword-only argument, it needs to be specified after * symbol in the argument list, e.g:

    *,
    reason: Optional[str] = None,
To make something a keyword-only argument, it needs to be specified after `*` symbol in the argument list, e.g: ```suggestion *, reason: Optional[str] = None, ```
Jackenmen (Migrated from github.com) reviewed 2022-10-12 22:30:07 +02:00
@ -29,6 +31,8 @@ async def mass_purge(
The messages to bulk delete.
Jackenmen (Migrated from github.com) commented 2022-10-12 22:30:06 +02:00
    reason : `str`, optional
```suggestion reason : `str`, optional ```
Kowlin (Migrated from github.com) approved these changes 2022-10-12 23:02:06 +02:00
Kowlin (Migrated from github.com) left a comment

Despite Discord not accepting reasons for mass deleted messages (while saying its supported by their docs) this still gets send through properly. And is handled fine.

Despite Discord not accepting reasons for mass deleted messages (while saying its supported by [their docs](https://discord.com/developers/docs/resources/channel#bulk-delete-messages)) this still gets send through properly. And is handled fine.
Sign in to join this conversation.
No reviewers
No labels
Automated PR
Blocked
Blocked By: Damage Control
Blocked By: Dependency
Blocked By: Other PR
Breaking Change
Category: CI
Category: Cogs - Admin
Category: Cogs - Alias
Category: Cogs - Audio
Category: Cogs - Bank
Category: Cogs - Cleanup
Category: Cogs - CustomCommands
Category: Cogs - Dev
Category: Cogs - Downloader
Category: Cogs - Economy
Category: Cogs - Filter
Category: Cogs - General
Category: Cogs - Image
Category: Cogs - Mod
Category: Cogs - Modlog
Category: Cogs - Mutes
Category: Cogs - Permissions
Category: Cogs - Reports
Category: Cogs - Streams
Category: Cogs - Trivia
Category: Cogs - Trivia - Lists
Category: Cogs - Warnings
Category: Core - API - App Commands Package
Category: Core - API - Audio
Category: Core - API - Bank
Category: Core - API - Commands Package
Category: Core - API - Config
Category: Core - API - Other
Category: Core - API - Utils Package
Category: Core - Bot Class
Category: Core - Bot Commands
Category: Core - Command-line Interfaces
Category: Core - Downloader
Category: Core - Help
Category: Core - i18n
Category: Core - Modlog
Category: Core - Other Internals
Category: Core - RPC/ZMQ
Category: Docker
Category: Docs - Changelogs
Category: Docs - For Developers
Category: Docs - Install Guides
Category: Docs - Other
Category: Docs - User Guides
Category: Meta
Category: RPC/ZMQ methods
Category: Vendored Packages
Changelog Entry: Added
Changelog Entry: Pending
Changelog Entry: Skipped
Closed: Duplicate
Closed: External
Closed: Invalid
Closed: User Error
Closed: Won't Fix
Complex Issue
Docs-only
Feature Branch
Good First Issue
Help Wanted
High Priority
Needs Backport To stable-docs
No Activity
No Repro
QA: Bypassed
QA: Changes Requested
QA: Passed
Release Blocker
Status: Accepted
Status: Frozen
Status: In Progress
Status: Needs Discussion
Status: Needs Info
Status: Needs Triage
Status: PRs Welcome
Type: Bug
Type: Dependency Update
Type: Deprecation
Type: Enhancement
Type: Feature
Type: Informational
Type: Merge
Type: Optimisation
Type: Question
Type: Removal
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
Mrcoolgamer11/Red-DiscordBot!5863
No description provided.