hikari icon indicating copy to clipboard operation
hikari copied to clipboard

Allow async iterators in `delete_messages`

Open ashleney opened this issue 3 years ago • 0 comments

Summary

rest.delete_messages should allow the use of both sync and async/lazy iterators.

Why is this needed?

Users should not be forced to chunk iterators themselves if they want to delete and fetch the history at the same time.

Ideal implementation

Instead of having a list of pending messages, it would be better to cast the iterable into a LazyIterator and use iterator.chunk(). While this may reduce the performance by a few nanoseconds it will improve user experience.

ashleney avatar Apr 09 '22 12:04 ashleney