diff --git a/README.md b/README.md index 5fbcfac..936c8f7 100644 --- a/README.md +++ b/README.md @@ -9,13 +9,13 @@ 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.2 +dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.3 ``` Direct: ```bash -pip install "dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.2" +pip install "dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v0.1.3" ``` Requires `discord.py` (pulled transitively). diff --git a/pyproject.toml b/pyproject.toml index 5d83596..e994982 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "hatchling.build" [project] name = "dpy_paginator" -version = "0.1.2" +version = "0.1.3" 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 ef12075..1c70a08 100644 --- a/src/dpy_paginator/dpy_paginator.py +++ b/src/dpy_paginator/dpy_paginator.py @@ -200,7 +200,7 @@ class ButtonPaginator(Generic[PageT_co], discord.ui.View): async def interaction_check(self, interaction: Interaction) -> bool: """restrict interaction to author_id when set""" - if not self.author_id or self.author_id == interaction.user.id: + if self.author_id is None or self.author_id == interaction.user.id: return True await interaction.response.send_message("You cannot interact with this menu.", ephemeral=True) return False @@ -259,6 +259,14 @@ class ButtonPaginator(Generic[PageT_co], discord.ui.View): if isinstance(value, discord.Attachment): value = await value.to_file() self._page_kwargs["files"].append(value) + elif key in ("embed", "embeds", "file", "files"): + # a wrong-typed embed/file would otherwise fall to the catch-all and + # be forwarded verbatim, colliding with the base embeds=[]/files=[] + # and raising an opaque TypeError from inside discord.py — reject it + # here with a clear, paginator-side message + raise ValueError( + f"page key {key!r} has unexpected type {type(value).__name__}" + ) else: self._page_kwargs[key] = value elif isinstance(formatted_page, str):