Having problems with payload.type

Hi
I am a newbe and have a problem when sending data to telegram . I get the error “msg.payload.type is empty”

my function code:

var temp = msg.payload + " °C";
msg.payload.type = “message”;
msg.payload.chatId = “xxxxxxxxxx”;
msg.payload.content = temp;
return msg;

Maybe the " on line 2 and 3

Nope, the " has to be there

Try this.

let temp = msg.payload + " °C";

let newMsg = { payload:
    {
    type: "message",
    chatId: "xxxxxxxxxx",
    content: temp
    }
};

return newMsg;

Yes, but you are using the wrong " in line 2 and 3