def emitter(self):
while not self.closed:
now = time.monotonic()
send_delta = now - self._last_emit
if send_delta < 5:
await asyncio.sleep(5 - send_delta)
self._last_emit = time.monotonic()
paginator = commands.Paginator(prefix='', suffix='')
for chunk in self._buffer:
paginator.add_line(chunk.strip())
self._buffer.clear()
self._can_emit.clear()
for page in paginator.pages:
await self.webhook.execute(page)
await self._can_emit.wait()
评论列表
文章目录