fix: rebuild fresh File per render, convert Attachments in files= list, thread page state through locals
discord.py closes a discord.File's fp after every send/edit, so reusing the same File object across renders raised ValueError on navigating back to a file page; reset_files now rebuilds a fresh File from the same source instead. The dict page 'files' list never converted discord.Attachment to File (unlike the singular 'file' key), crashing reset_files with AttributeError; it now converts via to_file() like its sibling. get_page_kwargs also built render state in instance attributes across real await points, letting two near-simultaneous interactions interleave into a merged render; it now builds in locals and threads them through the recursive branch, publishing self.current_page_buttons only once a page is fully assembled. Bump to v0.1.5. Signed-off-by: disqualifier <dev@disqualifier.me>
This commit is contained in:
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "dpy_paginator"
|
||||
version = "0.1.4"
|
||||
version = "0.1.5"
|
||||
description = "Button-navigated paginator for discord.py — config-free, injectable emojis, installable."
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
Reference in New Issue
Block a user