is there a way i can get all the messages in a channel and get the message content of each message?
title
7 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
14.7.1 and 17.8.0
No, you can't.
really its not possible?
then what does channel.messages.fetch do?
less than 100
i couldnt figure out how to put them all into an array
do you know how i could do that?
i want to access the content of each message
Converting a Collection to an array
You only need to convert it to an array if you need the index of an entry:
• Iteration (looping) is possible with
for...of
over Collection#values
or forEach
• You can transform a Collection to an array with Collection#map
• If you need indices, you can get the array using [...collection.values()]
oh well i did not know that lol
ty
is there something wrong with how im doing thins or am i just using .map() wrong?
channel.messages.fetch({ limit: 100 }).map(message => message.content);
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View