I have the channel object, and I've tried
mess = channel.history(limit=200)
but mess is a HistoryIterator object and does not contain any messages in its mess.messages object (size = 0). There are messages in the channel, so it shouldn't say the size is 0.
I've also tried:
mess = client.logs_from(channel, limit=200)
but PyCharm tells me that client has no logs_from function.
Is there an easy way to get all of the messages from a text channel in an array?
HistoryIterator implements the AsyncIterator interface. You can use the AsyncIterator.flatten method to consume the contents of the Iterator into a list:
messages = await channel.history(limit=200).flatten()
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With