Encode message when call send_message