Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Received Interactions come with a channel object #2025

Merged
merged 6 commits into from Apr 25, 2023

Conversation

NeloBlivion
Copy link
Member

Summary

All interactions now come with a partial channel object over the gateway as per discord/discord-api-docs#6051

  • DMChannel and GroupChannel can successfully be received in this manner
'channel': {'type': 1, 'last_pin_timestamp': '2022-02-06T14:08:54+00:00', 'last_message_id': '1095172313105846322', 'id': '456499933701341204', 'flags': 0}
  • Changed channel to a regular attribute instead of a cached slot, though i've currently left the previous property in.
  • DMChannel.recipients has been adjusted to support said attribute being missing from gateway events

This PR is functionally done, however I'm not entirely sure if this is a good implementation; I think there's merit in using the received channel object, but would it be better to continue using cache? Should we implement additional methods here?

Information

  • This PR fixes an issue.
  • 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.

@NeloBlivion NeloBlivion requested a review from a team as a code owner April 24, 2023 20:17
@codecov
Copy link

codecov bot commented Apr 24, 2023

Codecov Report

Merging #2025 (0a8012e) into master (33d1744) will increase coverage by 0.00%.
The diff coverage is 15.00%.

❗ Current head 0a8012e differs from pull request most recent head 389f45e. Consider uploading reports for the commit 389f45e to get more accurate results

Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2025   +/-   ##
=======================================
  Coverage   33.29%   33.30%           
=======================================
  Files          97       97           
  Lines       18973    18965    -8     
=======================================
- Hits         6317     6316    -1     
+ Misses      12656    12649    -7     
Flag Coverage Δ
macos-latest-3.10 33.28% <15.00%> (-0.01%) ⬇️
macos-latest-3.11 33.28% <15.00%> (?)
macos-latest-3.8 33.29% <15.00%> (?)
macos-latest-3.9 33.29% <15.00%> (-0.01%) ⬇️
ubuntu-latest-3.10 33.28% <15.00%> (-0.01%) ⬇️
ubuntu-latest-3.11 33.28% <15.00%> (-0.01%) ⬇️
ubuntu-latest-3.8 33.29% <15.00%> (-0.01%) ⬇️
ubuntu-latest-3.9 33.29% <15.00%> (-0.01%) ⬇️
windows-latest-3.10 33.28% <15.00%> (?)
windows-latest-3.11 33.28% <15.00%> (?)
windows-latest-3.8 33.29% <15.00%> (?)
windows-latest-3.9 33.29% <15.00%> (?)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
discord/channel.py 34.01% <0.00%> (-0.10%) ⬇️
discord/interactions.py 19.73% <13.33%> (-0.32%) ⬇️
discord/types/interactions.py 98.52% <50.00%> (-0.73%) ⬇️

... and 4 files with indirect coverage changes


Continue to review full report in Codecov by Sentry.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 33d1744...389f45e. Read the comment docs.

@plun1331 plun1331 changed the title feat?: Received Interactions come with a channel object feat: Received Interactions come with a channel object Apr 24, 2023
@Lulalaby Lulalaby added priority: medium Medium Priority feature Implements a feature changelog needed labels Apr 25, 2023
Copy link
Member

@Lulalaby Lulalaby left a comment

Choose a reason for hiding this comment

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

Changelog

@Lulalaby Lulalaby enabled auto-merge (squash) April 25, 2023 17:39
@Lulalaby Lulalaby merged commit 6a72ff0 into Pycord-Development:master Apr 25, 2023
25 checks passed
@NeloBlivion NeloBlivion mentioned this pull request Apr 25, 2024
9 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature Implements a feature priority: medium Medium Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants