Skip to content

Commit 29af8a9

Browse files
Merge pull request #184 from python-discord/bump-d.py
Bump d.py & update view with user and role check
2 parents 4c1060a + ff765b4 commit 29af8a9

File tree

6 files changed

+61
-49
lines changed

6 files changed

+61
-49
lines changed

.pre-commit-config.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
repos:
22
- repo: https://github.com/pre-commit/pre-commit-hooks
3-
rev: v4.2.0
3+
rev: v4.4.0
44
hooks:
55
- id: check-merge-conflict
66
- id: check-toml

docs/changelog.rst

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,12 @@
44
Changelog
55
=========
66

7+
8+
- :feature:`184` Remove the message stored in the ``message`` attr of :obj:`pydis_core.utils.interactions.ViewWithUserAndRoleCheck` when the interaction is stopped, in additional to the exist logic for timeout.
9+
- :support:`184` Bump Discord.py to :literal-url:`2.3.1 <https://github.com/Rapptz/discord.py/releases/tag/v2.3.1>`.
710
- :bug:`187` Fix :obj:`pydis_core.utils.channel.get_or_fetch_channel`'s return type to include :obj:`discord.abc.PrivateChannel` and :obj:`discord.Thread`.
811

12+
913
- :release:`9.9.2 <2nd July 2023>`
1014
- :bug:`185` Update expiry label from 1 month to 30 days in paste service.
1115

poetry.lock

Lines changed: 42 additions & 41 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pydis_core/async_stats.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ def __init__(
1616
loop: asyncio.AbstractEventLoop,
1717
host: str = "localhost",
1818
port: int = 8125,
19-
prefix: str = None
19+
prefix: str | None = None
2020
):
2121
"""
2222
Create a new :obj:`AsyncStatsClient`.

pydis_core/utils/interactions.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
from discord import ButtonStyle, HTTPException, Interaction, Message, NotFound, ui
55

66
from pydis_core.utils.logging import get_logger
7+
from pydis_core.utils.scheduling import create_task
78

89
log = get_logger(__name__)
910

@@ -80,6 +81,12 @@ async def interaction_check(self, interaction: Interaction) -> bool:
8081
await interaction.response.send_message("This is not your button to click!", ephemeral=True)
8182
return False
8283

84+
def stop(self) -> None:
85+
"""Stop listening for interactions, and remove the view from ``self.message`` if set."""
86+
super().stop()
87+
if self.message:
88+
create_task(_handle_modify_message(self.message, "edit"))
89+
8390
async def on_timeout(self) -> None:
8491
"""Remove the view from ``self.message`` if set."""
8592
if self.message:

pyproject.toml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[tool.poetry]
22
name = "pydis_core"
3-
version = "9.9.1"
3+
version = "9.9.2"
44
description = "PyDis core provides core functionality and utility to the bots of the Python Discord community."
55
authors = ["Python Discord <[email protected]>"]
66
license = "MIT"
@@ -25,7 +25,7 @@ keywords = ["bot", "discord", "discord.py"]
2525
[tool.poetry.dependencies]
2626
python = "3.10.* || 3.11.*"
2727

28-
"discord.py" = "2.3.0"
28+
"discord.py" = "2.3.1"
2929
async-rediscache = { version = "1.0.0rc2", extras = ["fakeredis"], optional = true }
3030
statsd = "4.0.1"
3131
aiodns = "3.0.0"
@@ -38,20 +38,20 @@ taskipy = "1.11.0"
3838
python-dotenv = "1.0.0"
3939

4040
[tool.poetry.group.test.dependencies]
41-
pytest = "7.3.2"
41+
pytest = "7.4.0"
4242
pytest-cov = "4.1.0"
4343
pytest-xdist = "3.3.1"
4444

4545
[tool.poetry.group.lint.dependencies]
4646
isort = "5.12.0"
47-
ruff = "0.0.272"
48-
pre-commit = "3.3.2"
47+
ruff = "0.0.275"
48+
pre-commit = "3.3.3"
4949
typing-extensions = "4.6.3"
5050

5151
[tool.poetry.group.doc.dependencies]
5252
Sphinx = "7.0.1"
5353
GitPython = "3.1.31"
54-
sphinx-autodoc-typehints = "1.23.0"
54+
sphinx-autodoc-typehints = "1.23.2"
5555
furo = "2023.5.20"
5656
six = "1.16.0"
5757
releases = "2.1.1"

0 commit comments

Comments
 (0)