Skip to content

Commit

Permalink
Merge branch 'master' into feat-media-channels
Browse files Browse the repository at this point in the history
  • Loading branch information
Paillat-dev authored Dec 18, 2024
2 parents 19e4bed + 9259f38 commit 3aeebfd
Show file tree
Hide file tree
Showing 52 changed files with 4,316 additions and 4,323 deletions.
18 changes: 10 additions & 8 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2590](https://github.com/Pycord-Development/pycord/pull/2590))
- Added missing `with_counts` parameter to `fetch_guilds` method.
([#2615](https://github.com/Pycord-Development/pycord/pull/2615))
- Added missing permissions: `Permissions.use_soundboard`,
`Permissions.use_external_sounds` and
- Added the following missing permissions: `Permissions.use_soundboard`,
`Permissions.use_external_sounds`, and
`Permissions.view_creator_monetization_analytics`.
([#2620](https://github.com/Pycord-Development/pycord/pull/2620))
- Added `MediaChannel` channel type.
Expand All @@ -56,7 +56,7 @@ These changes are available on the `master` branch, but have not yet been releas
([#2595](https://github.com/Pycord-Development/pycord/pull/2595))
- Fixed `BucketType.category` cooldown commands not functioning correctly in private
channels. ([#2603](https://github.com/Pycord-Development/pycord/pull/2603))
- Fixed `SlashCommand`'s `ctx` parameter couldn't be `Union` type.
- Fixed `ctx` parameter of a `SlashCommand` not being `Union` type.
([#2611](https://github.com/Pycord-Development/pycord/pull/2611))
- Fixed `TypeError` when passing `skus` parameter in `Client.entitlements()`.
([#2627](https://github.com/Pycord-Development/pycord/issues/2627))
Expand All @@ -66,6 +66,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2641](https://github.com/Pycord-Development/pycord/pull/2641))
- Fixed `AttributeError` when accessing `Member.guild_permissions` for user installed
apps. ([#2650](https://github.com/Pycord-Development/pycord/pull/2650))
- Fixed type annotations of cached properties.
([#2635](https://github.com/Pycord-Development/pycord/issues/2635))

### Changed

Expand Down Expand Up @@ -392,7 +394,7 @@ These changes are available on the `master` branch, but have not yet been releas
([#2075](https://github.com/Pycord-Development/pycord/pull/2075))
- Fixed `before_invoke` not being run for `SlashCommandGroup`.
([#2091](https://github.com/Pycord-Development/pycord/pull/2091))
- Fixed `AttributeError` when accessing a `Select` object's values when it hasn't been
- Fixed `AttributeError` when accessing a `Select` object's values when it has not been
interacted with. ([#2104](https://github.com/Pycord-Development/pycord/pull/2104))
- Fixed `before_invoke` being run twice for slash subcommands.
([#2139](https://github.com/Pycord-Development/pycord/pull/2139))
Expand Down Expand Up @@ -423,7 +425,7 @@ These changes are available on the `master` branch, but have not yet been releas
([#2196](https://github.com/Pycord-Development/pycord/pull/2196))
- Fixed `AttributeError` when running permission checks without the `bot` scope.
([#2113](https://github.com/Pycord-Development/pycord/issues/2113))
- Fixed `Option` not working on bridge commands because `ext.commands.Command` doesn't
- Fixed `Option` not working on bridge commands because `ext.commands.Command` does not
recognize them. ([#2256](https://github.com/Pycord-Development/pycord/pull/2256))
- Fixed offset-aware tasks causing `TypeError` when being prepared.
([#2271](https://github.com/Pycord-Development/pycord/pull/2271))
Expand Down Expand Up @@ -523,7 +525,7 @@ These changes are available on the `master` branch, but have not yet been releas
### Fixed

- Fixed bugs in `Page.update_files` where file objects stored in memory were causing an
`AttributeError`, and `io.BytesIO` files didn't send properly more than once.
`AttributeError`, and `io.BytesIO` files did not send properly more than once.
([#1869](https://github.com/Pycord-Development/pycord/pull/1869) &
[#1881](https://github.com/Pycord-Development/pycord/pull/1881))
- Fixed bridge groups missing the `parent` attribute.
Expand Down Expand Up @@ -878,9 +880,9 @@ These changes are available on the `master` branch, but have not yet been releas
([#1453](https://github.com/Pycord-Development/pycord/pull/1453))
- Update `thread.members` on `thread.fetch_members`.
([#1464](https://github.com/Pycord-Development/pycord/pull/1464))
- Fix the error when Discord doesn't send the `app_permissions` data in `Interaction`.
- Fix the error when Discord does not send the `app_permissions` data in `Interaction`.
([#1467](https://github.com/Pycord-Development/pycord/pull/1467))
- Fix AttributeError when voice client `play()` function isn't completed yet.
- Fix AttributeError when voice client `play()` function is not completed yet.
([#1360](https://github.com/Pycord-Development/pycord/pull/1360))

## [2.0.0-rc.1] - 2022-05-17
Expand Down
3 changes: 2 additions & 1 deletion discord/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,8 @@ def _handle_ready(self) -> None:

@property
def latency(self) -> float:
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds.
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds. If no websocket
is present, this returns ``nan``, and if no heartbeat has been received yet, this returns ``float('inf')``.
This could be referred to as the Discord WebSocket protocol latency.
"""
Expand Down
4 changes: 3 additions & 1 deletion discord/gateway.py
Original file line number Diff line number Diff line change
Expand Up @@ -581,7 +581,9 @@ async def received_message(self, msg, /):

@property
def latency(self) -> float:
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds."""
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds. If no heartbeat
has been received yet this returns ``float('inf')``.
"""
heartbeat = self._keep_alive
return float("inf") if heartbeat is None else heartbeat.latency

Expand Down
4 changes: 3 additions & 1 deletion discord/shard.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,9 @@ async def connect(self) -> None:

@property
def latency(self) -> float:
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds for this shard."""
"""Measures latency between a HEARTBEAT and a HEARTBEAT_ACK in seconds for this shard. If no heartbeat
has been received yet this returns ``float('inf')``.
"""
return self._parent.ws.latency

def is_ws_ratelimited(self) -> bool:
Expand Down
3 changes: 1 addition & 2 deletions discord/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@
Iterator,
Literal,
Mapping,
NewType,
Protocol,
Sequence,
TypeVar,
Expand Down Expand Up @@ -151,7 +150,7 @@ def __get__(self, instance, owner):
class _RequestLike(Protocol):
headers: Mapping[str, Any]

cached_property = NewType("cached_property", property)
cached_property = property

P = ParamSpec("P")

Expand Down
Binary file modified docs/build/locales/.doctrees/api/clients.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/api/index.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/api/models.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/api/utils.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/api/voice.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/changelog.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/ext/bridge/api.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/ext/bridge/index.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/ext/commands/api.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/ext/commands/index.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/build/locales/.doctrees/old_changelog.doctree
Binary file not shown.
Loading

0 comments on commit 3aeebfd

Please sign in to comment.