Skip to content

Commit 85b5934

Browse files
committed
fix: target for 2.9
1 parent 636bc8f commit 85b5934

4 files changed

Lines changed: 36 additions & 33 deletions

File tree

discord/channel.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1663,6 +1663,9 @@ def _update_status(
16631663

16641664
@property
16651665
def voice_start_time(self) -> datetime.datetime | None:
1666+
""":class:`datetime.datetime` | :class:`None`: The time that the voice session started.
1667+
1668+
.. versionadded:: 2.9"""
16661669
if self._voice_start_time is None:
16671670
return None
16681671
return datetime.datetime.fromtimestamp(self._voice_start_time, tz=datetime.UTC)

discord/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -236,7 +236,7 @@ class Client:
236236
cache_channel_info: :class:`bool`
237237
Whether to automatically request and cache channel statuses on startup. Defaults to ``False``.
238238
239-
.. versionadded:: 2.8
239+
.. versionadded:: 2.9
240240
241241
Attributes
242242
-----------

discord/guild.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3960,7 +3960,7 @@ async def channel_info(self, *, cache: bool = True) -> None | list[ChannelInfo]:
39603960
39613961
Requests all channel statuses for this guild over the websocket.
39623962
3963-
.. versionadded:: 1.5
3963+
.. versionadded:: 2.9
39643964
39653965
Parameters
39663966
----------

discord/raw_models.py

Lines changed: 31 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -490,36 +490,6 @@ def __init__(self, data: VoiceChannelStatusUpdateEvent) -> None:
490490
self.data: VoiceChannelStatusUpdateEvent = data
491491

492492

493-
class RawVoiceChannelStartTimeUpdateEvent(_RawReprMixin):
494-
"""Represents the payload for an :func:`on_raw_voice_channel_start_time_update` event.
495-
496-
.. versionadded:: 2.5
497-
498-
Attributes
499-
----------
500-
id: :class:`int`
501-
The channel ID where the voice channel start time update originated from.
502-
guild_id: :class:`int`
503-
The guild ID where the voice channel start time update originated from.
504-
voice_start_time: Optional[:class:`datetime.datetime`]
505-
The new new voice channel start time.
506-
data: :class:`dict`
507-
The raw data sent by the `gateway <https://docs.discord.com/developers/events/gateway-events-events#voice-channel-start-time-update>`__.
508-
"""
509-
510-
__slots__ = ("id", "guild_id", "voice_start_time", "data")
511-
512-
def __init__(self, data: VoiceChannelStartTimeUpdateEvent) -> None:
513-
self.id: int = int(data["id"])
514-
self.guild_id: int = int(data["guild_id"])
515-
self.voice_start_time: datetime.datetime | None = (
516-
datetime.datetime.fromtimestamp(data["voice_start_time"], tz=datetime.UTC)
517-
if data.get("voice_start_time")
518-
else None
519-
)
520-
self.data: VoiceChannelStartTimeUpdateEvent = data
521-
522-
523493
class RawTypingEvent(_RawReprMixin):
524494
"""Represents the payload for a :func:`on_raw_typing` event.
525495
@@ -1065,10 +1035,40 @@ def __init__(self, data: MemberUpdateEvent, member: Member) -> None:
10651035
self.member: Member = member
10661036

10671037

1038+
class RawVoiceChannelStartTimeUpdateEvent(_RawReprMixin):
1039+
"""Represents the payload for an :func:`on_raw_voice_channel_start_time_update` event.
1040+
1041+
.. versionadded:: 2.9
1042+
1043+
Attributes
1044+
----------
1045+
id: :class:`int`
1046+
The channel ID where the voice channel start time update originated from.
1047+
guild_id: :class:`int`
1048+
The guild ID where the voice channel start time update originated from.
1049+
voice_start_time: Optional[:class:`datetime.datetime`]
1050+
The new new voice channel start time.
1051+
data: :class:`dict`
1052+
The raw data sent by the `gateway <https://docs.discord.com/developers/events/gateway-events-events#voice-channel-start-time-update>`__.
1053+
"""
1054+
1055+
__slots__ = ("id", "guild_id", "voice_start_time", "data")
1056+
1057+
def __init__(self, data: VoiceChannelStartTimeUpdateEvent) -> None:
1058+
self.id: int = int(data["id"])
1059+
self.guild_id: int = int(data["guild_id"])
1060+
self.voice_start_time: datetime.datetime | None = (
1061+
datetime.datetime.fromtimestamp(data["voice_start_time"], tz=datetime.UTC)
1062+
if data.get("voice_start_time")
1063+
else None
1064+
)
1065+
self.data: VoiceChannelStartTimeUpdateEvent = data
1066+
1067+
10681068
class ChannelInfo(_RawReprMixin):
10691069
"""Represents the gateway response to a request for channel information.
10701070
1071-
.. versionadded:: 2.8
1071+
.. versionadded:: 2.9
10721072
10731073
Attributes
10741074
----------

0 commit comments

Comments
 (0)