Support all Messageables in bot.embed_requested() #5576

Merged
Jackenmen merged 4 commits from break_embed_requested_a_bit into V3/develop 2022-03-21 17:22:55 +01:00
Jackenmen commented 2022-02-19 05:08:16 +01:00 (Migrated from github.com)

Description of the changes

await User.create_dm(), no more :)

This PR makes the following changes to the signature of Red.embed_requested():

  • channel parameter now accepts all kinds of Messageable objects
    • for Context, Context.channel is used and command is auto-filled with Context.command
    • for GroupChannel, only global settings are checked (bots can't send to group channels but it's part of the Messageable contract)
  • user parameter has been removed
    • I know that if we instead just ignored the user param, we could avoid breakage but 3.5 seems like the right time to do this + there's a chance this results in more people using command so seems like a win to me :)
  • command parameter has been made keyword-only
    • this makes it so that bot.embed_requested(channel, user) usage correctly starts raising errors
    • and it's a better choice for this parameter anyway

We could also do another breakage and have check_permissions default to True as it seems like a more sane default though I have not done this change for now. Opinions here would be very much welcome.

### Description of the changes `await User.create_dm()`, no more :) This PR makes the following changes to the signature of `Red.embed_requested()`: - `channel` parameter now accepts all kinds of `Messageable` objects - for `Context`, `Context.channel` is used and `command` is auto-filled with `Context.command` - for `GroupChannel`, only global settings are checked (bots can't send to group channels but it's part of the `Messageable` contract) - `user` parameter has been removed - I know that if we instead just ignored the `user` param, we could avoid breakage but 3.5 seems like the right time to do this + there's a chance this results in more people using `command` so seems like a win to me :) - `command` parameter has been made keyword-only - this makes it so that `bot.embed_requested(channel, user)` usage correctly starts raising errors - and it's a better choice for this parameter anyway We *could* also do another breakage and have `check_permissions` default to True as it seems like a more sane default though I have not done this change for now. Opinions here would be very much welcome.
TrustyJAID (Migrated from github.com) reviewed 2022-03-21 02:51:16 +01:00
TrustyJAID (Migrated from github.com) left a comment

I think we should set the default forcheck_permissions to True. It just makes more sense and can allow cog creators to more reliably know if they're even allowed to send embeds. Overall this is a fairly underutilized method that can absolutely be improved.

I think we should set the default for`check_permissions` to `True`. It just makes more sense and can allow cog creators to more reliably know if they're even allowed to send embeds. Overall this is a fairly underutilized method that can absolutely be improved.
TrustyJAID (Migrated from github.com) approved these changes 2022-03-21 17:20:43 +01:00
TrustyJAID (Migrated from github.com) left a comment

Looks good to me.

Looks good to me.
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!5576
No description provided.