<s> """<STR_LIT>""" <EOL> from . user import User <EOL> from . game import Game <EOL> from . import utils <EOL> from . enums import Status <EOL> from . colour import Colour <EOL> class Member ( User ) : <EOL> """<STR_LIT>""" <EOL> __slots__ = [ '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT>' , '<STR_LIT:status>' , '<STR_LIT>' , <EOL> '<STR_LIT>' , '<STR_LIT>' ] <EOL> def __init__ ( self , ** kwargs ) : <EOL> super ( ) . __init__ ( ** kwargs . get ( '<STR_LIT:user>' ) ) <EOL> self . deaf = kwargs . get ( '<STR_LIT>' ) <EOL> self . mute = kwargs . get ( '<STR_LIT>' ) <EOL> self . joined_at = utils . parse_time ( kwargs . get ( '<STR_LIT>' ) ) <EOL> self . roles = kwargs . get ( '<STR_LIT>' , [ ] ) <EOL> self . status = Status . offline <EOL> game = kwargs . get ( '<STR_LIT>' , { } ) <EOL> self . game = Game ( ** game ) if game else None <EOL> self . server = kwargs . get ( '<STR_LIT>' , None ) <EOL> self . nick = kwargs . get ( '<STR_LIT>' , None ) <EOL> self . _update_voice_state ( mute = self . mute , deaf = self . deaf ) <EOL> def _update_voice_state ( self , ** kwargs ) : <EOL> self . self_mute = kwargs . get ( '<STR_LIT>' , False ) <EOL> self . self_deaf = kwargs . get ( '<STR_LIT>' , False ) <EOL> self . is_afk = kwargs . get ( '<STR_LIT>' , False ) <EOL> self . mute = kwargs . get ( '<STR_LIT>' , False ) <EOL> self . deaf = kwargs . get ( '<STR_LIT>' , False ) <EOL> old_channel = getattr ( self , '<STR_LIT>' , None ) <EOL> self . voice_channel = kwargs . get ( '<STR_LIT>' ) <EOL> if old_channel is None and self . voice_channel is not None : <EOL> self . voice_channel . voice_members . append ( self ) <EOL> elif old_channel is not None : <EOL> try : <EOL> old_channel . voice_members . remove ( self ) <EOL> except ValueError : <EOL> pass <EOL> finally : <EOL> if self . voice_channel is not None : <EOL> self . voice_channel . voice_members . append ( self ) <EOL> @ property <EOL> def colour ( self ) : <EOL> """<STR_LIT>""" <EOL> if self . roles : <EOL> role = max ( self . roles , key = lambda r : r . position ) <EOL> return role . colour <EOL> else : <EOL> return Colour . default ( ) <EOL> color = colour <EOL> @ property <EOL> def mention ( self ) : <EOL> if self . nick : <EOL> return '<STR_LIT>' . format ( self . id ) <EOL> return '<STR_LIT>' . format ( self . id ) <EOL> def mentioned_in ( self , message ) : <EOL> mentioned = super ( ) . mentioned_in ( message ) <EOL> if mentioned : <EOL> return True <EOL> for role in message . role_mentions : <EOL> has_role = utils . get ( self . roles , id = role . id ) is not None <EOL> if has_role : <EOL> return True <EOL> return False </s>
