Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bump d.py & update view with user and role check #184

Merged
merged 4 commits into from
Jul 14, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.2.0
rev: v4.4.0
hooks:
- id: check-merge-conflict
- id: check-toml
Expand Down
4 changes: 4 additions & 0 deletions docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,12 @@
Changelog
=========


- :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.
- :support:`184` Bump Discord.py to :literal-url:`2.3.1 <https://github.com/Rapptz/discord.py/releases/tag/v2.3.1>`.
- :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`.


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

Expand Down
83 changes: 42 additions & 41 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pydis_core/async_stats.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ def __init__(
loop: asyncio.AbstractEventLoop,
host: str = "localhost",
port: int = 8125,
prefix: str = None
prefix: str | None = None
):
"""
Create a new :obj:`AsyncStatsClient`.
Expand Down
7 changes: 7 additions & 0 deletions pydis_core/utils/interactions.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
from discord import ButtonStyle, HTTPException, Interaction, Message, NotFound, ui

from pydis_core.utils.logging import get_logger
from pydis_core.utils.scheduling import create_task

log = get_logger(__name__)

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

def stop(self) -> None:
"""Stop listening for interactions, and remove the view from ``self.message`` if set."""
super().stop()
if self.message:
create_task(_handle_modify_message(self.message, "edit"))

async def on_timeout(self) -> None:
"""Remove the view from ``self.message`` if set."""
if self.message:
Expand Down
12 changes: 6 additions & 6 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "pydis_core"
version = "9.9.1"
version = "9.9.2"
description = "PyDis core provides core functionality and utility to the bots of the Python Discord community."
authors = ["Python Discord <info@pythondiscord.com>"]
license = "MIT"
Expand All @@ -25,7 +25,7 @@ keywords = ["bot", "discord", "discord.py"]
[tool.poetry.dependencies]
python = "3.10.* || 3.11.*"

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

[tool.poetry.group.test.dependencies]
pytest = "7.3.2"
pytest = "7.4.0"
pytest-cov = "4.1.0"
pytest-xdist = "3.3.1"

[tool.poetry.group.lint.dependencies]
isort = "5.12.0"
ruff = "0.0.272"
pre-commit = "3.3.2"
ruff = "0.0.275"
pre-commit = "3.3.3"
typing-extensions = "4.6.3"

[tool.poetry.group.doc.dependencies]
Sphinx = "7.0.1"
GitPython = "3.1.31"
sphinx-autodoc-typehints = "1.23.0"
sphinx-autodoc-typehints = "1.23.2"
furo = "2023.5.20"
six = "1.16.0"
releases = "2.1.1"
Expand Down