diff --git a/README.md b/README.md index ec1d3d2..4fe2d37 100644 --- a/README.md +++ b/README.md @@ -9,18 +9,18 @@ buttons) behind previous / jump / next navigation, with an optional cache button `requirements.txt`: ``` -dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.8 +dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.9 ``` Direct: ```bash -pip install "dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.8" +pip install "dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.9" ``` Requires `discord.py` (pulled transitively). -Drop the `@v0.1.8` suffix from the line above to install the latest unpinned. +Drop the `@v0.1.9` suffix from the line above to install the latest unpinned. ## Basic usage @@ -61,6 +61,11 @@ those, or a `dict`. A dict page can carry `content`, `embed`/`embeds`, `files` accept a `discord.Attachment` and convert it via `to_file()` automatically — you never need to convert an attachment before passing it in. +With `per_page > 1`, multiple entries render onto one page. `content` from each +entry (whether a plain `str` entry or a dict's `content` key) joins with `\n` in +order, same as `embeds`/`files`/`buttons` accumulate — no entry's content is +dropped in favor of another's. + File pages are safe to navigate back to. discord.py closes a `discord.File`'s underlying handle after every send/edit, so the paginator never resends your File object directly — it rebuilds a fresh `discord.File` from the same source (path or diff --git a/pyproject.toml b/pyproject.toml index 84767d7..7eb5602 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "dpy_paginator" -version = "0.1.8" +version = "0.1.9" description = "Button-navigated paginator for discord.py — config-free, injectable emojis, installable." requires-python = ">=3.10" dependencies = [ diff --git a/src/dpy_paginator/dpy_paginator.py b/src/dpy_paginator/dpy_paginator.py index 1976871..3381ba1 100644 --- a/src/dpy_paginator/dpy_paginator.py +++ b/src/dpy_paginator/dpy_paginator.py @@ -279,6 +279,9 @@ class DPYPaginator(Generic[PageT_co], discord.ui.View): raise ValueError( f"page key {key!r} has unexpected type {type(value).__name__}" ) + elif key == "content": + existing = kwargs["content"] + kwargs["content"] = value if existing is None else f"{existing}\n{value}" else: kwargs[key] = value elif isinstance(formatted_page, str):