[Modlog API] Fundamental change to modlog API #2897

Closed
opened 2019-07-21 21:59:22 +02:00 by DiscordLiz · 3 comments
DiscordLiz commented 2019-07-21 21:59:22 +02:00 (Migrated from github.com)

Feature request

Select the type of feature you are requesting:

  • Cog
  • Command
  • API functionality

Describe your requested feature

The modlog API should not auto-detect events caused by the bot.

  • This would allow the simplification of interacting with the modlog API.
  • This would make interacting with the modlog API easier, but required for certain actions.
  • This would not remove auto-detecting bans made by moderators through the discord interface rather than the bot

A practical case and rationale

While working on #2866, I noticed there is no clean way to create a case type for multiple audit log entries. In wanting to allow role mutes to be supplemented with permission overwrites as needed, I would need a case type which supported multiple audit log actions.

Rather than change the modlog API to support this, removing the action type all together and just not detecting actions the bot took allows cleaner ease of use.

Downsides

This does mean that someone can't do a ban with a reason and have an audit log entry automatically generated, they would need to create a case.

Mitigating the impact of downsides

If we provide a few pre-registered case types which cover generic use already registered and support their use, the downside becomes one extra import and one extra line per mod action.

Breakage

This would remove a key from the dicts used in case registration.
This would be a change in expected behavior if cogs are not updated for this.

# Feature request #### Select the type of feature you are requesting: - [ ] Cog - [ ] Command - [X] API functionality #### Describe your requested feature The modlog API should not auto-detect events caused by the bot. - This would allow the simplification of interacting with the modlog API. - This would make interacting with the modlog API easier, but required for certain actions. - This would not remove auto-detecting bans made by moderators through the discord interface rather than the bot ### A practical case and rationale While working on #2866, I noticed there is no clean way to create a case type for multiple audit log entries. In wanting to allow role mutes to be supplemented with permission overwrites as needed, I would need a case type which supported multiple audit log actions. Rather than change the modlog API to support this, removing the action type all together and just not detecting actions the bot took allows cleaner ease of use. ### Downsides This does mean that someone can't do a ban with a reason and have an audit log entry automatically generated, they would need to create a case. ### Mitigating the impact of downsides If we provide a few pre-registered case types which cover generic use already registered and support their use, the downside becomes one extra import and one extra line per mod action. ### Breakage This would remove a key from the dicts used in case registration. This would be a change in expected behavior if cogs are not updated for this.
mikeshardmind commented 2019-07-21 22:16:20 +02:00 (Migrated from github.com)

So long as this doesn't add too much work for 3rd party cog creators, these changes can be made.

Should I take the practical example and that it would help the other PR you are working on as being willing to work on this, or leave it unassigned for anyone interested to pick up?

So long as this doesn't add too much work for 3rd party cog creators, these changes can be made. Should I take the practical example and that it would help the other PR you are working on as being willing to work on this, or leave it unassigned for anyone interested to pick up?
DiscordLiz commented 2019-07-21 22:17:42 +02:00 (Migrated from github.com)

I'm willing to make the changes.

I'm willing to make the changes.
mikeshardmind commented 2019-07-22 02:31:14 +02:00 (Migrated from github.com)

Just for clarity, the parsing in mod with get_audit_log_info + the event listener there for automatic case generation without a (discord) audit log entry is why this key is currently being used in core red. any modification around this should address that.

Just for clarity, the parsing in mod with `get_audit_log_info` + the event listener there for automatic case generation without a (discord) audit log entry is why this key is currently being used in core red. any modification around this should address that.
Sign in to join this conversation.
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#2897
No description provided.