<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def _parse_metadata(self, message):
 """ Sets metadata in Legobot message Args: message (dict):
 Full message from Discord websocket connection" Returns: Legobot.Metadata """


        metadata = Metadata(source=self.actor_urn).__dict__
        if 'author' in message['d']:
            metadata['source_user'] = message['d']['author']['username']
        else:
            metadata['source_user'] = None
        if 'channel_id' in message['d']:
            metadata['source_channel'] = message['d']['channel_id']
        else:
            metadata['source_channel'] = None
        metadata['user_id'] = metadata['source_user']
        metadata['display_name'] = metadata['source_user']

        metadata['source_connector'] = 'discord'

        return metadata