Skip to content

Commit 2e24724

Browse files
committed
Support discord.Object in event locations
1 parent bfdbfba commit 2e24724

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

discord/scheduled_events.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@
3838
from .errors import ValidationError
3939
from .iterators import ScheduledEventSubscribersIterator
4040
from .mixins import Hashable
41+
from .object import Object
4142

4243
__all__ = (
4344
"ScheduledEvent",
@@ -73,7 +74,7 @@ class ScheduledEventLocation:
7374
7475
Attributes
7576
----------
76-
value: Union[:class:`str`, :class:`StageChannel`, :class:`VoiceChannel`]
77+
value: Union[:class:`str`, :class:`StageChannel`, :class:`VoiceChannel`, :class:`Object`]
7778
The actual location of the scheduled event.
7879
type: :class:`ScheduledEventLocationType`
7980
The type of location.
@@ -91,9 +92,9 @@ def __init__(
9192
value: Union[str, int, StageChannel, VoiceChannel],
9293
):
9394
self._state = state
94-
self.value: Union[str, StageChannel, VoiceChannel]
95+
self.value: Union[str, StageChannel, VoiceChannel, Object]
9596
if isinstance(value, int):
96-
self.value = self._state._get_guild_channel({"channel_id": int(value)})
97+
self.value = self._state.get_channel(id=int(value)) or Object(id=int(value))
9798
else:
9899
self.value = value
99100

0 commit comments

Comments
 (0)