Get all messages in channel

I'm trying to get the content of posts from a specific channel by its ID, but the content is always empty even though the posts contain understandable text
const channelId = interaction.options.getChannel("channel").id

const receiveChannel = client.channels.cache.get(channelId);
const message = await receiveChannel.messages.fetch({ limit: 10 })
.then(messages=> console.log(messages))
.catch(console.error);
const channelId = interaction.options.getChannel("channel").id

const receiveChannel = client.channels.cache.get(channelId);
const message = await receiveChannel.messages.fetch({ limit: 10 })
.then(messages=> console.log(messages))
.catch(console.error);
3 Replies
Unknown User
Unknown Userā€¢2y ago
Message Not Public
Sign In & Join Server To View
chewie šŸŒˆ
chewie šŸŒˆā€¢2y ago
you are missing good ol MessageContent intent @prayforukraine
Alexcitten
Alexcittenā€¢2y ago
Ah, my bad Thanks