@ -562,17 +562,17 @@ class Guild(Hashable):
self . _add_thread ( Thread ( guild = self , state = self . _state , data = thread ) )
self . _add_thread ( Thread ( guild = self , state = self . _state , data = thread ) )
@property
@property
def channels ( self ) - > List [ GuildChannel ] :
def channels ( self ) - > Sequence [ GuildChannel ] :
""" List [:class:`abc.GuildChannel`]: A list of channels that belongs to this guild."""
""" Sequence [:class:`abc.GuildChannel`]: A list of channels that belongs to this guild."""
return list ( self . _channels . values ( ) )
return utils . SequenceProxy ( self . _channels . values ( ) )
@property
@property
def threads ( self ) - > List [ Thread ] :
def threads ( self ) - > Sequence [ Thread ] :
""" List [:class:`Thread`]: A list of threads that you have permission to view.
""" Sequence [:class:`Thread`]: A list of threads that you have permission to view.
. . versionadded : : 2.0
. . versionadded : : 2.0
"""
"""
return list ( self . _threads . values ( ) )
return utils . SequenceProxy ( self . _threads . values ( ) )
@property
@property
def large ( self ) - > bool :
def large ( self ) - > bool :
@ -817,9 +817,9 @@ class Guild(Hashable):
return self . _PREMIUM_GUILD_LIMITS [ self . premium_tier ] . filesize
return self . _PREMIUM_GUILD_LIMITS [ self . premium_tier ] . filesize
@property
@property
def members ( self ) - > List [ Member ] :
def members ( self ) - > Sequence [ Member ] :
""" List [:class:`Member`]: A list of members that belong to this guild."""
""" Sequence [:class:`Member`]: A list of members that belong to this guild."""
return list ( self . _members . values ( ) )
return utils . SequenceProxy ( self . _members . values ( ) )
def get_member ( self , user_id : int , / ) - > Optional [ Member ] :
def get_member ( self , user_id : int , / ) - > Optional [ Member ] :
""" Returns a member with the given ID.
""" Returns a member with the given ID.
@ -846,13 +846,13 @@ class Guild(Hashable):
return [ member for member in self . members if member . premium_since is not None ]
return [ member for member in self . members if member . premium_since is not None ]
@property
@property
def roles ( self ) - > List [ Role ] :
def roles ( self ) - > Sequence [ Role ] :
""" List[:class:`Role`]: Returns a :class:`list` of the guild' s roles in hierarchy order.
""" Sequence[:class:`Role`]: Returns a sequence of the guild' s roles in hierarchy order.
The first element of this list will be the lowest role in the
The first element of this sequence will be the lowest role in the
hierarchy .
hierarchy .
"""
"""
return sorted ( self . _roles . values ( ) )
return utils . SequenceProxy ( self . _roles . values ( ) , sorted = True )
def get_role ( self , role_id : int , / ) - > Optional [ Role ] :
def get_role ( self , role_id : int , / ) - > Optional [ Role ] :
""" Returns a role with the given ID.
""" Returns a role with the given ID.
@ -904,13 +904,13 @@ class Guild(Hashable):
return None
return None
@property
@property
def stage_instances ( self ) - > List [ StageInstance ] :
def stage_instances ( self ) - > Sequence [ StageInstance ] :
""" List[:class:`StageInstance`]: Returns a :class:`list` of the guild' s stage instances that
""" Sequence[:class:`StageInstance`]: Returns a sequence of the guild' s stage instances that
are currently running .
are currently running .
. . versionadded : : 2.0
. . versionadded : : 2.0
"""
"""
return list ( self . _stage_instances . values ( ) )
return utils . SequenceProxy ( self . _stage_instances . values ( ) )
def get_stage_instance ( self , stage_instance_id : int , / ) - > Optional [ StageInstance ] :
def get_stage_instance ( self , stage_instance_id : int , / ) - > Optional [ StageInstance ] :
""" Returns a stage instance with the given ID.
""" Returns a stage instance with the given ID.
@ -930,12 +930,12 @@ class Guild(Hashable):
return self . _stage_instances . get ( stage_instance_id )
return self . _stage_instances . get ( stage_instance_id )
@property
@property
def scheduled_events ( self ) - > List [ ScheduledEvent ] :
def scheduled_events ( self ) - > Sequence [ ScheduledEvent ] :
""" List[:class:`ScheduledEvent`]: Returns a :class:`list` of the guild' s scheduled events.
""" Sequence[:class:`ScheduledEvent`]: Returns a sequence of the guild' s scheduled events.
. . versionadded : : 2.0
. . versionadded : : 2.0
"""
"""
return list ( self . _scheduled_events . values ( ) )
return utils . SequenceProxy ( self . _scheduled_events . values ( ) )
def get_scheduled_event ( self , scheduled_event_id : int , / ) - > Optional [ ScheduledEvent ] :
def get_scheduled_event ( self , scheduled_event_id : int , / ) - > Optional [ ScheduledEvent ] :
""" Returns a scheduled event with the given ID.
""" Returns a scheduled event with the given ID.