#How do I get the referenced user id from a referenced message?

1 messages · Page 1 of 1 (latest)

spiral rock
let prevMessages = await message.channel.messages.fetch({ limit: 15 });
            prevMessages.reverse();
            await message.channel.sendTyping()
  
            prevMessages.forEach((msg) => {
                if (msg.author.id === message.author.id) {
                    conversationLog.push({
                        "role": "user",
                        "content": msg.content
                    });
                } else if (msg.author.bot && /* is a reference to a message sent by the msg.author*/) {
                    conversationLog.push({
                        "role": "assistant",
                        "content": msg.content
                    });
                }
            });``` Heres my code