MessageIterator
An asynchronous message iterator over the given text channel.
Attributes channel :
The channel, what's messages the message iterator will iterates over.
int
The amount of messages, what the message iterator will extend it's channel's message history, each time, the loaded messages are exhausted.
The client, who will do the api requests for requesting more messages.
bool
Tells the message iterator, whether it's client can read the history if it's channel.
int
The index of the message, what will be yielded.
Methods
(client, channel, ...)
__new__Creates a message iterator.
This method is a coroutine.
Parameter | Type | Optional | Description |
---|---|---|---|
client | The client, who will do the api requests for requesting more messages. | ||
channel |
| The channel, what's messages the message iterator will iterates over. | |
chunk_size |
| The amount of messages, what the message iterator will extend it's channel's message history, each time, the loaded messages are exhausted. Limited to |
Raises
TypeError
If channel
was not given neither as Channel
nor int
.
ConnectionError
No internet connection.
DiscordException
If any exception was received from the Discord API.
AssertionError
- If
chunk_size
was not given asint
. - If
chunk_size
is out of range [1:].
()
__aiter__Returns self and resets the .index
.
()
__anext__Yields the next message of the iterator's channel.
This method is a coroutine.
()
__repr__Returns the representation of the message iterator.