Skip to content

Commit c6200e8

Browse files
authored
Merge branch 'master' into master
2 parents 3c8551c + c58505e commit c6200e8

File tree

6 files changed

+21
-14
lines changed

6 files changed

+21
-14
lines changed

discord/client.py

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -256,6 +256,9 @@ def __init__(
256256
VoiceClient.warn_nacl = False
257257
_log.warning("PyNaCl is not installed, voice will NOT be supported")
258258

259+
# Used to hard-reference tasks so they don't get garbage collected (discarded with done_callbacks)
260+
self._tasks = set()
261+
259262
async def __aenter__(self) -> Client:
260263
loop = asyncio.get_running_loop()
261264
self.loop = loop
@@ -423,8 +426,12 @@ def _schedule_event(
423426
**kwargs: Any,
424427
) -> asyncio.Task:
425428
wrapped = self._run_event(coro, event_name, *args, **kwargs)
426-
# Schedules the task
427-
return asyncio.create_task(wrapped, name=f"pycord: {event_name}")
429+
430+
# Schedule task and store in set to avoid task garbage collection
431+
task = asyncio.create_task(wrapped, name=f"pycord: {event_name}")
432+
self._tasks.add(task)
433+
task.add_done_callback(self._tasks.discard)
434+
return task
428435

429436
def dispatch(self, event: str, *args: Any, **kwargs: Any) -> None:
430437
_log.debug("Dispatching event %s", event)

discord/commands/options.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ def option(name, input_type=None, **kwargs):
424424
Attributes
425425
----------
426426
parameter_name: :class:`str`
427-
The name of the target parameter this option is mapped to.
427+
The name of the target function parameter this option is mapped to.
428428
This allows you to have a separate UI ``name`` and parameter name.
429429
"""
430430

discord/ext/bridge/core.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -660,7 +660,7 @@ def bridge_option(name, input_type=None, **kwargs):
660660
Attributes
661661
----------
662662
parameter_name: :class:`str`
663-
The name of the target parameter this option is mapped to.
663+
The name of the target function parameter this option is mapped to.
664664
This allows you to have a separate UI ``name`` and parameter name.
665665
"""
666666

discord/ext/commands/errors.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -212,10 +212,10 @@ class CheckAnyFailure(CheckFailure):
212212
"""
213213

214214
def __init__(
215-
self, checks: list[CheckFailure], errors: list[Callable[[Context], bool]]
215+
self, checks: list[Callable[[Context], bool]], errors: list[CheckFailure]
216216
) -> None:
217-
self.checks: list[CheckFailure] = checks
218-
self.errors: list[Callable[[Context], bool]] = errors
217+
self.checks: list[Callable[[Context], bool]] = checks
218+
self.errors: list[CheckFailure] = errors
219219
super().__init__("You do not have permission to run this command.")
220220

221221

discord/ui/input_text.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class InputText:
3636
The maximum number of characters that can be entered.
3737
Must be between 1 and 4000.
3838
required: Optional[:class:`bool`]
39-
Whether the input text field is required or not. Defaults to `True`.
39+
Whether the input text field is required or not. Defaults to ``True``.
4040
value: Optional[:class:`str`]
4141
Pre-fills the input text field with this value.
4242
Must be 4000 characters or fewer.
@@ -151,7 +151,7 @@ def placeholder(self, value: str | None):
151151

152152
@property
153153
def min_length(self) -> int | None:
154-
"""The minimum number of characters that must be entered. Defaults to `0`."""
154+
"""The minimum number of characters that must be entered. Defaults to 0."""
155155
return self._underlying.min_length
156156

157157
@min_length.setter
@@ -177,7 +177,7 @@ def max_length(self, value: int | None):
177177

178178
@property
179179
def required(self) -> bool | None:
180-
"""Whether the input text field is required or not. Defaults to `True`."""
180+
"""Whether the input text field is required or not. Defaults to ``True``."""
181181
return self._underlying.required
182182

183183
@required.setter

requirements/dev.txt

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
-r _.txt
2-
pylint~=3.2.5
3-
pytest~=8.2.2
2+
pylint~=3.2.6
3+
pytest~=8.3.2
44
pytest-asyncio~=0.23.3
55
# pytest-order~=1.0.1
6-
mypy~=1.10.1
6+
mypy~=1.11.1
77
coverage~=7.6
88
pre-commit==3.5.0
99
codespell==2.3.0
1010
bandit==1.7.9
11-
flake8==7.1.0
11+
flake8==7.1.1

0 commit comments

Comments
 (0)