getMessagesAround

open override fun getMessagesAround(messageId: Snowflake, channelId: Snowflake, limit: Int): Flow<Message>(source)

Requests a flow of messages created around the Message with the messageId in the MessageChannel with the channelId.

Unlike getMessagesAfter and getMessagesBefore, this flow can return a maximum of 100 messages. As such, the accepted range of limit is reduced to 1..100.

Supplied messages will be equally distributed before and after the messageId. The remaining message for an odd limit is undefined and may appear on either side or no side at all.

If a Message with the given messageId exists, the flow might also contain it, so it could have one more element than the given limit.

The returned flow is lazily executed, any RequestException will be thrown on terminal operators instead.

Throws

if the limit is outside the range of 1..100.