Compare commits
2
Commits
v1.1.0
...
c51b89bcf6
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
c51b89bcf6 | ||
|
|
eb4c3efb28 |
No files matched your search
@@ -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@v1.0.0
|
||||
dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v1.2.0
|
||||
```
|
||||
|
||||
Direct:
|
||||
|
||||
```bash
|
||||
pip install "dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v1.0.0"
|
||||
pip install "dpy_paginator @ git+ssh://git@git.rethinkstudios.io/rethink-public/dpy_paginator.git@v1.2.0"
|
||||
```
|
||||
|
||||
Requires `discord.py` (pulled transitively).
|
||||
|
||||
Drop the `@v1.0.0` suffix from the line above to install the latest unpinned.
|
||||
Drop the `@v1.2.0` suffix from the line above to install the latest unpinned.
|
||||
|
||||
## Basic usage
|
||||
|
||||
@@ -149,7 +149,8 @@ through.
|
||||
- `timeout` — seconds before the view stops (default 180)
|
||||
- `delete_message_after` — delete the message on timeout
|
||||
- `per_page` — entries per page (default 1)
|
||||
- `mentions_allowed` — `AllowedMentions` for sends (default `.all()`)
|
||||
- `mentions_allowed` — `AllowedMentions` for sends (default `AllowedMentions(everyone=False)`:
|
||||
no @everyone/@here, user/role pings and the bot-wide settings still apply)
|
||||
- `ephemeral` — send/edit ephemerally
|
||||
- `page_text` — format string for the jump button label
|
||||
- `emojis` — override navigation emojis
|
||||
|
||||
+1
-1
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
|
||||
|
||||
[project]
|
||||
name = "dpy_paginator"
|
||||
version = "1.1.0"
|
||||
version = "1.2.0"
|
||||
description = "Button-navigated paginator for discord.py — config-free, injectable emojis, installable."
|
||||
requires-python = ">=3.10"
|
||||
dependencies = [
|
||||
|
||||
@@ -85,7 +85,8 @@ class JumpToPageModal(discord.ui.Modal, title="Jump to Page"):
|
||||
"""modal that lets a user jump to a specific page"""
|
||||
|
||||
def __init__(self, paginator: "DPYPaginator"):
|
||||
super().__init__()
|
||||
# share the paginator's timeout so a dismissed modal leaves discord.py's ViewStore
|
||||
super().__init__(timeout=paginator.timeout)
|
||||
self.paginator = paginator
|
||||
self.page_number = discord.ui.TextInput(
|
||||
label="Enter page number",
|
||||
@@ -142,7 +143,8 @@ class DPYPaginator(Generic[PageT_co], discord.ui.View):
|
||||
timeout: seconds before the view stops
|
||||
delete_message_after: delete the message on timeout
|
||||
per_page: how many entries render per page
|
||||
mentions_allowed: AllowedMentions for sends (defaults to all)
|
||||
mentions_allowed: AllowedMentions for sends (default: no @everyone/@here;
|
||||
user/role pings and the bot-wide settings still apply)
|
||||
ephemeral: send/edit ephemerally
|
||||
page_text: format string for the jump button label
|
||||
emojis: override navigation emojis (keys: previous/next/cache)
|
||||
@@ -155,7 +157,7 @@ class DPYPaginator(Generic[PageT_co], discord.ui.View):
|
||||
raise ValueError("per_page must be >= 1")
|
||||
self.author_id: Optional[int] = author_id
|
||||
self.delete_message_after: bool = delete_message_after
|
||||
self.mentions_allowed = mentions_allowed or discord.AllowedMentions.all()
|
||||
self.mentions_allowed = mentions_allowed or discord.AllowedMentions(everyone=False)
|
||||
self.ephemeral: bool = ephemeral
|
||||
self.current_page: int = 0
|
||||
self.per_page: int = per_page
|
||||
|
||||
Reference in new issue
Block a user