d.py 2.3 / pomelo changes #6130

Merged
Jackenmen merged 15 commits from dpy_2.3 into V3/develop 2023-06-14 04:56:50 +02:00
Jackenmen commented 2023-05-05 04:43:15 +02:00 (Migrated from github.com)

Description of the changes

Let's open this early to have some time to discuss this.

List of changes:

  • Updated global unique user finder in Audio to match by global name as well
  • Replaced manual construction of user handle in Audio and Modlog with str(author)
  • Updated audit log reasons in Admin to use str(author) rather than author.name
  • Updated logs in Cleanup, Mod, and Trivia to use user handles
  • Updated usage of User/Member.name with display_name attribute in places where we're supposed to show the display name ([p]serverinfo, [p]leaderboard, [p]bankset reset, [p]set showsettings, Red's CLI splash screen, )
  • Updated name tracking in Mod to track both the usernames and display names
  • Updated last known username tracking in Modlog
  • Altered Red.is_automod_immune() to consider all bots immune

TODO:

  • Figure out if there's going to be an endpoint for changing the app/global name and add [p]set bot globalname if so

Discussion questions:

  • I was forced to update the handling of User objects in Red.is_automod_immune() - it is no longer possible for me to differ between webhook users and bots (it would be if we did not accept discord.abc.User directly - I need a message object to know if something was sent a webhook) and as such I decided to consider all bots to be immune to auto-moderation. Is this fine?

Have the changes in this PR been tested?

No

### Description of the changes Let's open this early to have some time to discuss this. List of changes: - Updated global unique user finder in Audio to match by global name as well - Replaced manual construction of user handle in Audio and Modlog with `str(author)` - Updated audit log reasons in Admin to use `str(author)` rather than `author.name` - Updated logs in Cleanup, Mod, and Trivia to use user handles - Updated usage of `User/Member.name` with `display_name` attribute in places where we're supposed to show the display name (`[p]serverinfo`, `[p]leaderboard`, `[p]bankset reset`, `[p]set showsettings`, Red's CLI splash screen, ) - Updated name tracking in Mod to track both the usernames and display names - Updated last known username tracking in Modlog - Altered `Red.is_automod_immune()` to consider *all* bots immune TODO: - Figure out if there's going to be an endpoint for changing the app/global name and add `[p]set bot globalname` if so Discussion questions: - I was forced to update the handling of `User` objects in `Red.is_automod_immune()` - it is no longer possible for me to differ between webhook users and bots (it would be if we did not accept `discord.abc.User` directly - I need a message object to know if something was sent a webhook) and as such I decided to consider all bots to be immune to auto-moderation. Is this fine? ### Have the changes in this PR been tested? No
aikaterna (Migrated from github.com) reviewed 2023-05-05 04:43:15 +02:00
PredaaA (Migrated from github.com) reviewed 2023-05-05 04:43:15 +02:00
Jackenmen commented 2023-05-05 05:08:05 +02:00 (Migrated from github.com)

I updated the description with a list of changes and todo/discussion items.

I updated the description with a list of changes and todo/discussion items.
Flame442 (Migrated from github.com) reviewed 2023-05-07 04:05:02 +02:00
@ -274,2 +274,3 @@
author = ctx.author
reason = "{}({}) changed the colour of role '{}'".format(author.name, author.id, role.name)
reason = _("{author} ({author.id}) changed the colour of role '{role.name}'").format(
author=author, role=role.name
Flame442 (Migrated from github.com) commented 2023-05-07 04:05:01 +02:00

I'm pretty sure this (and similar) will error, because having named fillins requires kwargs in the format call.

I'm pretty sure this (and similar) will error, because having named fillins requires kwargs in the format call.
Jackenmen (Migrated from github.com) reviewed 2023-05-07 05:47:41 +02:00
@ -274,2 +274,3 @@
author = ctx.author
reason = "{}({}) changed the colour of role '{}'".format(author.name, author.id, role.name)
reason = _("{author} ({author.id}) changed the colour of role '{role.name}'").format(
author=author, role=role.name
Jackenmen (Migrated from github.com) commented 2023-05-07 05:47:41 +02:00

Of course, this is fixed now, thanks!

Of course, this is fixed now, thanks!
Jackenmen commented 2023-05-07 05:50:06 +02:00 (Migrated from github.com)

I've updated this PR with most of the things that were previously listed as TODOs. We're now left with potentially having to add [p]set bot globalname if Discord adds an endpoint for it and figuring out whether the new behavior of Red.is_automod_immune() is acceptable. Of course, any feedback about the other changes is welcome too.

I've updated this PR with most of the things that were previously listed as TODOs. We're now left with potentially having to add `[p]set bot globalname` *if* Discord adds an endpoint for it and figuring out whether the new behavior of `Red.is_automod_immune()` is acceptable. Of course, any feedback about the other changes is welcome too.
Flame442 (Migrated from github.com) requested changes 2023-06-14 04:04:29 +02:00
Flame442 (Migrated from github.com) commented 2023-06-14 04:04:19 +02:00
Traceback (most recent call last):
  File "venv\lib\site-packages\discord\client.py", line 441, in _run_event
    await coro(*args, **kwargs)
  File "venv\lib\site-packages\redbot\cogs\mod\events.py", line 185, in on_user_update
    async with self.config.user(before).past_display_names() as name_list:
  File "venv\lib\site-packages\redbot\core\config.py", line 363, in __getattr__
    raise AttributeError("'{}' is not a valid registered Group or value.".format(item))
AttributeError: 'past_display_names' is not a valid registered Group or value.

First thing in console when loading this on a bot. This key needs to be added to the defaults.

```py Traceback (most recent call last): File "venv\lib\site-packages\discord\client.py", line 441, in _run_event await coro(*args, **kwargs) File "venv\lib\site-packages\redbot\cogs\mod\events.py", line 185, in on_user_update async with self.config.user(before).past_display_names() as name_list: File "venv\lib\site-packages\redbot\core\config.py", line 363, in __getattr__ raise AttributeError("'{}' is not a valid registered Group or value.".format(item)) AttributeError: 'past_display_names' is not a valid registered Group or value. ``` First thing in console when loading this on a bot. This key needs to be added to the defaults.
Flame442 (Migrated from github.com) requested changes 2023-06-14 04:28:02 +02:00
Flame442 (Migrated from github.com) left a comment

Seems like everything else works besides this typo.

Seems like everything else works besides this typo.
@ -20,23 +21,23 @@ class ModInfo(MixinMeta):
Commands regarding names, userinfo, etc.
Flame442 (Migrated from github.com) commented 2023-06-14 04:22:05 +02:00
        usernames, display_names = user_data["past_names"], user_data["past_display_names"]
```suggestion usernames, display_names = user_data["past_names"], user_data["past_display_names"] ```
Flame442 (Migrated from github.com) approved these changes 2023-06-14 04:42:43 +02:00
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!6130
No description provided.