gets a user with given username if connected

def get_user(self, username):
        """ gets a user with given username if connected """
        for user in self.users:
            if user.id.name == username:
                return user
        return None