Change message in python from Message to dict.