Skip to content

fix: 🐛 Fix Interaction.channel incorrectly set#2658

Merged
Lulalaby merged 15 commits into
Pycord-Development:masterfrom
Paillat-dev:fix-interaction-channel-perms
Jan 10, 2025
Merged

fix: 🐛 Fix Interaction.channel incorrectly set#2658
Lulalaby merged 15 commits into
Pycord-Development:masterfrom
Paillat-dev:fix-interaction-channel-perms

Conversation

@Paillat-dev

@Paillat-dev Paillat-dev commented Nov 28, 2024

Copy link
Copy Markdown
Member

Summary

InteractionPayload["channel"] is partial, thus, when creating a GuildChannel object from it, some attributes were missing/incorrectly set. With this pr, InteractionPayload["channel"] is used only in the following cases:

  1. When the interaction happens in private channels.
  2. When the channel is missing from the bot's cache.

In all other cases, it uses the full channel object from the cache.

Information

  • This PR fixes an issue.
    fixes: permissions_for returning wrong permissions #2281
  • This PR adds something new (e.g. new method or parameters).
  • This PR is a breaking change (e.g. methods or parameters removed/renamed).
  • This PR is not a code change (e.g. documentation, README, typehinting,
    examples, ...).

Checklist

  • I have searched the open pull requests for duplicates.
  • If code changes were made then they have been tested.
    • I have updated the documentation to reflect the changes.
  • If type: ignore comments were used, a comment is also left explaining why.
  • I have updated the changelog to include these changes.

@Paillat-dev
Paillat-dev force-pushed the fix-interaction-channel-perms branch from 8683daa to 96a3141 Compare November 28, 2024 08:57
@Paillat-dev Paillat-dev changed the title 🐛 Fix Interaction.channel incorrectly set fix: 🐛 Fix Interaction.channel incorrectly set Nov 28, 2024
@NeloBlivion

Copy link
Copy Markdown
Member

Removing cached_channel makes this a breaking change; at most, it should be deprecated.

@Paillat-dev

Copy link
Copy Markdown
Member Author

Ok

@JustaSqu1d JustaSqu1d left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please fix changelog entry

Comment thread CHANGELOG.md Outdated
Comment thread discord/interactions.py Outdated
Lulalaby
Lulalaby previously approved these changes Dec 23, 2024
Comment thread discord/interactions.py
Comment thread discord/interactions.py Outdated
Comment thread discord/interactions.py Outdated
@Paillat-dev
Paillat-dev requested a review from Dorukyum December 27, 2024 22:41
Dorukyum
Dorukyum previously approved these changes Dec 28, 2024
@Lulalaby
Lulalaby enabled auto-merge (squash) January 10, 2025 05:49
@Lulalaby
Lulalaby merged commit 24c1a8e into Pycord-Development:master Jan 10, 2025
@Dorukyum

Copy link
Copy Markdown
Member

Should've added a changelog entry under "Deprecated".

@Paillat-dev
Paillat-dev deleted the fix-interaction-channel-perms branch January 10, 2025 11:14
@Paillat-dev

Copy link
Copy Markdown
Member Author

I'll open another pr

@Dorukyum

Copy link
Copy Markdown
Member

No need, I'll push it while updating the changelog at the time of release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

permissions_for returning wrong permissions

5 participants