57
57
class ScheduledEventLocation :
58
58
"""Represents a scheduled event's location.
59
59
60
- Setting the ``location`` to its corresponding type will set the location type automatically:
61
- - :class:`StageChannel`: :attr:`ScheduledEventLocationType.external`
62
- - :class:`VoiceChannel`: :attr:`ScheduledEventLocationType.voice`
63
- - :class:`str`: :attr:`ScheduledEventLocationType.external`
60
+ Setting the ``value`` to its corresponding type will set the location type automatically:
61
+
62
+ +------------------------+---------------------------------------------------+
63
+ | Type of Input | Location Type |
64
+ +========================+===================================================+
65
+ | :class:`StageChannel`: | :attr:`ScheduledEventLocationType.stage_instance` |
66
+ | :class:`VoiceChannel`: | :attr:`ScheduledEventLocationType.voice` |
67
+ | :class:`str`: | :attr:`ScheduledEventLocationType.external` |
68
+ +------------------------+---------------------------------------------------+
64
69
65
70
.. versionadded:: 2.0
66
71
67
72
Attributes
68
73
----------
69
- value: Union[:class:`str`, :class:`int`, :class:` StageChannel`, :class:`VoiceChannel`]
74
+ value: Union[:class:`str`, :class:`StageChannel`, :class:`VoiceChannel`]
70
75
The actual location of the scheduled event.
71
76
type: :class:`ScheduledEventLocationType`
72
77
The type of location.
@@ -77,12 +82,13 @@ class ScheduledEventLocation:
77
82
'value' ,
78
83
)
79
84
80
- def __init__ (self , * , state : ConnectionState , location : Union [str , int , StageChannel , VoiceChannel ]):
85
+ def __init__ (self , * , state : ConnectionState , value : Union [str , int , StageChannel , VoiceChannel ]):
81
86
self ._state = state
82
- if isinstance (location , int ):
83
- self .value = self ._state ._get_guild_channel ({"channel_id" : int (location )})
87
+ self .value : Union [str , StageChannel , VoiceChannel ]
88
+ if isinstance (value , int ):
89
+ self .value = self ._state ._get_guild_channel ({"channel_id" : int (value )})
84
90
else :
85
- self .value = location
91
+ self .value = value
86
92
87
93
def __repr__ (self ) -> str :
88
94
return f"<ScheduledEventLocation value={ self .value } type={ self .type } >"
0 commit comments