<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:

def on_chat(self, data):
        ''' Transfert a message to everybody '''
        # XXX: we cannot use on_message as it's 'official' one already used
        # by sockjsroom to create multiple on_* elements (like on_chat),
        # so we use on_chat instead of on_message

        # data => message
        if self.roomId != '-1':
            self.publishToRoom(self.roomId, 'chat', {
                'username': self.username,
                'time': datetime.now(),
                'message': str(data['message'])
            })