From 5c609253da320f95e5e1cbb4d7a66c40e98285f4 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Fri, 9 Jan 2026 18:50:27 +0100 Subject: [PATCH 01/15] =?UTF-8?q?=F0=9F=93=9D=20Add=20missing=20docs=20to?= =?UTF-8?q?=20.respond=20methods?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ discord/interactions.py | 34 ++++++++++++++++++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index f3659e604b..baffed1be7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,6 +30,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `Interaction.channel` not being resolved with user-installed commands ran in guilds which the bot is not a member of. ([#3047](https://github.com/Pycord-Development/pycord/pull/3047)) +- Added missing documentation to `Interaction.respond` and `ApplicationContext.respond` methods. + ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated diff --git a/discord/interactions.py b/discord/interactions.py index 47498c6946..c90b679cdb 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -705,6 +705,40 @@ async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: Sends either a response or a message using the followup webhook determined by whether the interaction has been responded to or not. + Parameters + ---------- + content: Optional[:class:`str`] + The content of the message to send. + embeds: List[:class:`Embed`] + A list of embeds to send with the content. Maximum of 10. This cannot + be mixed with the ``embed`` parameter. + embed: :class:`Embed` + The rich embed for the content to send. This cannot be mixed with + ``embeds`` parameter. + tts: :class:`bool` + Indicates if the message should be sent using text-to-speech. + view: :class:`discord.ui.BaseView` + The view to send with the message. + ephemeral: :class:`bool` + Indicates if the message should only be visible to the user who started the interaction. + If a view is sent with an ephemeral message, and it has no timeout set then the timeout + is set to 15 minutes. + allowed_mentions: :class:`AllowedMentions` + Controls the mentions being processed in this message. + See :meth:`.abc.Messageable.send` for more information. + delete_after: :class:`float` + If provided, the number of seconds to wait in the background + before deleting the message we just sent. + file: :class:`File` + The file to upload. + files: List[:class:`File`] + A list of files to upload. Must be a maximum of 10. + poll: :class:`Poll` + The poll to send. + + .. versionadded:: 2.6 + + Returns ------- Union[:class:`discord.Interaction`, :class:`discord.WebhookMessage`]: From cbcc24593d4d7f05f5f16e87fbb567fae13f6ce1 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 9 Jan 2026 17:52:27 +0000 Subject: [PATCH 02/15] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 ++-- discord/interactions.py | 1 - 2 files changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index baffed1be7..a0faceb274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,8 +30,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `Interaction.channel` not being resolved with user-installed commands ran in guilds which the bot is not a member of. ([#3047](https://github.com/Pycord-Development/pycord/pull/3047)) -- Added missing documentation to `Interaction.respond` and `ApplicationContext.respond` methods. - ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) +- Added missing documentation to `Interaction.respond` and `ApplicationContext.respond` + methods. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated diff --git a/discord/interactions.py b/discord/interactions.py index c90b679cdb..aca9d38d08 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -738,7 +738,6 @@ async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: .. versionadded:: 2.6 - Returns ------- Union[:class:`discord.Interaction`, :class:`discord.WebhookMessage`]: From fce0c586912422c59c39fcd4828565821c8e2c0a Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 10 Jan 2026 14:45:13 +0100 Subject: [PATCH 03/15] Add overloads to type method properly (interaction) --- discord/interactions.py | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/discord/interactions.py b/discord/interactions.py index aca9d38d08..af1651acb5 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -27,7 +27,7 @@ import asyncio import datetime -from typing import TYPE_CHECKING, Any, Coroutine, Union +from typing import TYPE_CHECKING, Any, Coroutine, Union, overload from . import utils from .channel import ChannelType, PartialMessageable, _threaded_channel_factory @@ -699,6 +699,28 @@ async def delete_original_message(self, **kwargs): """ return await self.delete_original_response(**kwargs) + @overload + async def respond(self, + content: Any | None = None, + *args, + embed: Embed = None, + embeds: list[Embed] = None, + view: BaseView = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions = None, + file: File = None, + files: list[File] = None, + poll: Poll = None, + delete_after: float = None, + **kwargs + ) -> Interaction | WebhookMessage: + ... + + @overload + async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: + ... + async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: """|coro| From 75a338c1ed80382ac7ce9e02c94aa7cfd26904ec Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 10 Jan 2026 14:45:58 +0100 Subject: [PATCH 04/15] Add overloads to type method properly (ApplicationContext) --- discord/commands/context.py | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) diff --git a/discord/commands/context.py b/discord/commands/context.py index 73a6b39a45..e98ca8b2e4 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -25,7 +25,7 @@ from __future__ import annotations -from typing import TYPE_CHECKING, Any, TypeVar +from typing import TYPE_CHECKING, Any, TypeVar, overload import discord.abc from discord.interactions import Interaction, InteractionMessage, InteractionResponse @@ -38,15 +38,19 @@ import discord - from .. import Bot + from .. import AllowedMentions, Bot from ..client import ClientUser from ..cog import Cog + from ..embeds import Embed + from ..file import File from ..guild import Guild from ..interactions import InteractionChannel from ..member import Member from ..message import Message from ..permissions import Permissions + from ..poll import Poll from ..state import ConnectionState + from ..ui import BaseView from ..user import User from ..voice_client import VoiceClient from ..webhook import WebhookMessage @@ -277,9 +281,30 @@ def attachment_size_limit(self) -> int: def send_modal(self) -> Callable[..., Awaitable[Interaction]]: return self.interaction.response.send_modal - @property + @overload + async def respond(self, + content: Any | None = None, + *args, + embed: Embed = None, + embeds: list[Embed] = None, + view: BaseView = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions = None, + file: File = None, + files: list[File] = None, + poll: Poll = None, + delete_after: float = None, + **kwargs + ): + ... + + @overload + async def respond(self, *args, **kwargs): + ... + @discord.utils.copy_doc(Interaction.respond) - def respond( + async def respond( self, *args, **kwargs ) -> Callable[..., Awaitable[Interaction | WebhookMessage]]: return self.interaction.respond From f0aabccbd969eda63d17643da3c2a3642c5bbfc0 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 10 Jan 2026 13:47:22 +0000 Subject: [PATCH 05/15] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/commands/context.py | 35 +++++++++++++++++------------------ discord/interactions.py | 35 +++++++++++++++++------------------ 2 files changed, 34 insertions(+), 36 deletions(-) diff --git a/discord/commands/context.py b/discord/commands/context.py index e98ca8b2e4..3a75068506 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -282,26 +282,25 @@ def send_modal(self) -> Callable[..., Awaitable[Interaction]]: return self.interaction.response.send_modal @overload - async def respond(self, - content: Any | None = None, - *args, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, - tts: bool = False, - ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, - **kwargs - ): - ... + async def respond( + self, + content: Any | None = None, + *args, + embed: Embed = None, + embeds: list[Embed] = None, + view: BaseView = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions = None, + file: File = None, + files: list[File] = None, + poll: Poll = None, + delete_after: float = None, + **kwargs, + ): ... @overload - async def respond(self, *args, **kwargs): - ... + async def respond(self, *args, **kwargs): ... @discord.utils.copy_doc(Interaction.respond) async def respond( diff --git a/discord/interactions.py b/discord/interactions.py index af1651acb5..cd0bbf1002 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -700,26 +700,25 @@ async def delete_original_message(self, **kwargs): return await self.delete_original_response(**kwargs) @overload - async def respond(self, - content: Any | None = None, - *args, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, - tts: bool = False, - ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, - **kwargs - ) -> Interaction | WebhookMessage: - ... + async def respond( + self, + content: Any | None = None, + *args, + embed: Embed = None, + embeds: list[Embed] = None, + view: BaseView = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions = None, + file: File = None, + files: list[File] = None, + poll: Poll = None, + delete_after: float = None, + **kwargs, + ) -> Interaction | WebhookMessage: ... @overload - async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: - ... + async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: ... async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: """|coro| From ae1be07e665ba871614ccf772ca632279bbc8dfd Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sat, 10 Jan 2026 15:35:11 +0100 Subject: [PATCH 06/15] Adjust typing and make it a transparent passthrough --- discord/commands/context.py | 38 ++++++++++++++++++------------------- 1 file changed, 19 insertions(+), 19 deletions(-) diff --git a/discord/commands/context.py b/discord/commands/context.py index 3a75068506..ab69264ef5 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -283,30 +283,30 @@ def send_modal(self) -> Callable[..., Awaitable[Interaction]]: @overload async def respond( - self, - content: Any | None = None, - *args, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, - tts: bool = False, - ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, - **kwargs, - ): ... + self, + content: Any | None = None, + *args, + embed: Embed = None, + embeds: list[Embed] = None, + view: BaseView = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions = None, + file: File = None, + files: list[File] = None, + poll: Poll = None, + delete_after: float = None, + **kwargs, + ) -> Interaction | WebhookMessage: ... @overload - async def respond(self, *args, **kwargs): ... + async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: ... @discord.utils.copy_doc(Interaction.respond) async def respond( - self, *args, **kwargs - ) -> Callable[..., Awaitable[Interaction | WebhookMessage]]: - return self.interaction.respond + self, *args, **kwargs + ) -> Interaction | WebhookMessage: + return await self.interaction.respond(*args, **kwargs) @property @discord.utils.copy_doc(InteractionResponse.send_message) From 8870c20dd9073a97b9895d82ffc9d2f5ef749df8 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sat, 10 Jan 2026 14:35:45 +0000 Subject: [PATCH 07/15] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/commands/context.py | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/discord/commands/context.py b/discord/commands/context.py index ab69264ef5..76667d09e6 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -283,29 +283,27 @@ def send_modal(self) -> Callable[..., Awaitable[Interaction]]: @overload async def respond( - self, - content: Any | None = None, - *args, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, - tts: bool = False, - ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, - **kwargs, + self, + content: Any | None = None, + *args, + embed: Embed = None, + embeds: list[Embed] = None, + view: BaseView = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions = None, + file: File = None, + files: list[File] = None, + poll: Poll = None, + delete_after: float = None, + **kwargs, ) -> Interaction | WebhookMessage: ... @overload async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: ... @discord.utils.copy_doc(Interaction.respond) - async def respond( - self, *args, **kwargs - ) -> Interaction | WebhookMessage: + async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: return await self.interaction.respond(*args, **kwargs) @property From b725e9ee4c01edf9fea4e66892d50f7797e4bed4 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 11 Jan 2026 17:25:20 +0100 Subject: [PATCH 08/15] Add typing for args/kwargs --- discord/commands/context.py | 4 ++-- discord/interactions.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/discord/commands/context.py b/discord/commands/context.py index 76667d09e6..4e593a1d0d 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -285,7 +285,7 @@ def send_modal(self) -> Callable[..., Awaitable[Interaction]]: async def respond( self, content: Any | None = None, - *args, + *args: Any, embed: Embed = None, embeds: list[Embed] = None, view: BaseView = None, @@ -296,7 +296,7 @@ async def respond( files: list[File] = None, poll: Poll = None, delete_after: float = None, - **kwargs, + **kwargs: Any, ) -> Interaction | WebhookMessage: ... @overload diff --git a/discord/interactions.py b/discord/interactions.py index cd0bbf1002..a1ead4f961 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -703,7 +703,7 @@ async def delete_original_message(self, **kwargs): async def respond( self, content: Any | None = None, - *args, + *args: Any, embed: Embed = None, embeds: list[Embed] = None, view: BaseView = None, @@ -714,7 +714,7 @@ async def respond( files: list[File] = None, poll: Poll = None, delete_after: float = None, - **kwargs, + **kwargs: Any, ) -> Interaction | WebhookMessage: ... @overload From 67127fda4adf8f593887500ba76ca08265b26eae Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 11 Jan 2026 17:26:22 +0100 Subject: [PATCH 09/15] Adjust changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a0faceb274..fd058c73f4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,8 +30,9 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `Interaction.channel` not being resolved with user-installed commands ran in guilds which the bot is not a member of. ([#3047](https://github.com/Pycord-Development/pycord/pull/3047)) -- Added missing documentation to `Interaction.respond` and `ApplicationContext.respond` - methods. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) +- Added missing documentation and function parameters to `Interaction.respond` and + `ApplicationContext.respond` methods. + ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated From 638bbf6981bddb18c09f108aac26c5b59128b5b8 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 11 Jan 2026 17:58:21 +0100 Subject: [PATCH 10/15] =?UTF-8?q?=F0=9F=90=9B=20Make=20optional=20params?= =?UTF-8?q?=20optional?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 2 ++ discord/commands/context.py | 16 ++++++++-------- discord/interactions.py | 32 ++++++++++++++++---------------- 3 files changed, 26 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 05ec3fd555..10608cabef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,6 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas - Added missing documentation and function parameters to `Interaction.respond` and `ApplicationContext.respond` methods. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) +- Fixed optional parameters of `InteractionResponse.send_message` not being typed as such. + ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated diff --git a/discord/commands/context.py b/discord/commands/context.py index 4e593a1d0d..bea250d4f3 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -286,16 +286,16 @@ async def respond( self, content: Any | None = None, *args: Any, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, + embed: Embed | None = None, + embeds: list[Embed] | None = None, + view: BaseView | None = None, tts: bool = False, ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, + allowed_mentions: AllowedMentions | None = None, + file: File | None = None, + files: list[File] | None = None, + poll: Poll | None = None, + delete_after: float | None = None, **kwargs: Any, ) -> Interaction | WebhookMessage: ... diff --git a/discord/interactions.py b/discord/interactions.py index a1ead4f961..3fc7275fb4 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -704,16 +704,16 @@ async def respond( self, content: Any | None = None, *args: Any, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, + embed: Embed | None = None, + embeds: list[Embed] | None = None, + view: BaseView | None = None, tts: bool = False, ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, + allowed_mentions: AllowedMentions | None = None, + file: File | None = None, + files: list[File] | None = None, + poll: Poll | None = None, + delete_after: float | None = None, **kwargs: Any, ) -> Interaction | WebhookMessage: ... @@ -1005,16 +1005,16 @@ async def send_message( self, content: Any | None = None, *, - embed: Embed = None, - embeds: list[Embed] = None, - view: BaseView = None, + embed: Embed | None = None, + embeds: list[Embed] | None = None, + view: BaseView | None = None, tts: bool = False, ephemeral: bool = False, - allowed_mentions: AllowedMentions = None, - file: File = None, - files: list[File] = None, - poll: Poll = None, - delete_after: float = None, + allowed_mentions: AllowedMentions | None = None, + file: File | None = None, + files: list[File] | None = None, + poll: Poll | None = None, + delete_after: float | None = None, ) -> Interaction: """|coro| From 49262c934efa59804c3016270b5058954d6c6d3c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Sun, 11 Jan 2026 16:58:57 +0000 Subject: [PATCH 11/15] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 10608cabef..a390c1cf22 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,8 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas - Added missing documentation and function parameters to `Interaction.respond` and `ApplicationContext.respond` methods. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) -- Fixed optional parameters of `InteractionResponse.send_message` not being typed as such. - ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) +- Fixed optional parameters of `InteractionResponse.send_message` not being typed as + such. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated From c2713db328b47127a06b21cab559b3d5c7fefc24 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Tue, 13 Jan 2026 10:21:04 +0100 Subject: [PATCH 12/15] Update changelog --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index a390c1cf22..cb7b3178c2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -30,11 +30,12 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `Interaction.channel` not being resolved with user-installed commands ran in guilds which the bot is not a member of. ([#3047](https://github.com/Pycord-Development/pycord/pull/3047)) -- Added missing documentation and function parameters to `Interaction.respond` and - `ApplicationContext.respond` methods. +- Fixed `Interaction.respond` and `ApplicationContext.respond` methods to explicitly + list their accepted parameters. + ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) +- Fixed an issue where the optional parameters of `InteractionResponse.send_message` were + being typed as optional. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) -- Fixed optional parameters of `InteractionResponse.send_message` not being typed as - such. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated From 573370d19c2f3a6a6d3ee6b36d96712fc5ed0d2d Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 13 Jan 2026 09:22:48 +0000 Subject: [PATCH 13/15] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cb7b3178c2..9fea9a573a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -33,8 +33,8 @@ These changes are available on the `master` branch, but have not yet been releas - Fixed `Interaction.respond` and `ApplicationContext.respond` methods to explicitly list their accepted parameters. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) -- Fixed an issue where the optional parameters of `InteractionResponse.send_message` were - being typed as optional. +- Fixed an issue where the optional parameters of `InteractionResponse.send_message` + were being typed as optional. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated From deb1611f9cc16956bdd03c2e09b34a62966d2f51 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Wed, 14 Jan 2026 19:34:27 +0100 Subject: [PATCH 14/15] Change overloads --- discord/commands/context.py | 17 +++++++++++++++-- discord/interactions.py | 17 +++++++++++++++-- 2 files changed, 30 insertions(+), 4 deletions(-) diff --git a/discord/commands/context.py b/discord/commands/context.py index bea250d4f3..1ac7c08be7 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -287,7 +287,6 @@ async def respond( content: Any | None = None, *args: Any, embed: Embed | None = None, - embeds: list[Embed] | None = None, view: BaseView | None = None, tts: bool = False, ephemeral: bool = False, @@ -300,7 +299,21 @@ async def respond( ) -> Interaction | WebhookMessage: ... @overload - async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: ... + async def respond( + self, + content: Any | None = None, + *args: Any, + embeds: list[Embed] | None = None, + view: BaseView | None = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions | None = None, + file: File | None = None, + files: list[File] | None = None, + poll: Poll | None = None, + delete_after: float | None = None, + **kwargs: Any, + ) -> Interaction | WebhookMessage: ... @discord.utils.copy_doc(Interaction.respond) async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: diff --git a/discord/interactions.py b/discord/interactions.py index 3fc7275fb4..b2f09addb7 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -705,7 +705,6 @@ async def respond( content: Any | None = None, *args: Any, embed: Embed | None = None, - embeds: list[Embed] | None = None, view: BaseView | None = None, tts: bool = False, ephemeral: bool = False, @@ -718,7 +717,21 @@ async def respond( ) -> Interaction | WebhookMessage: ... @overload - async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: ... + async def respond( + self, + content: Any | None = None, + *args: Any, + embeds: list[Embed] | None = None, + view: BaseView | None = None, + tts: bool = False, + ephemeral: bool = False, + allowed_mentions: AllowedMentions | None = None, + file: File | None = None, + files: list[File] | None = None, + poll: Poll | None = None, + delete_after: float | None = None, + **kwargs: Any, + ) -> Interaction | WebhookMessage: ... async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: """|coro| From 50fa2a10a4200628e770f06d52a9b7203707249e Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Wed, 14 Jan 2026 21:05:56 +0100 Subject: [PATCH 15/15] Apply code change requests --- CHANGELOG.md | 2 +- discord/commands/context.py | 4 ---- discord/interactions.py | 4 ---- 3 files changed, 1 insertion(+), 9 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fea9a573a..cc0477f08b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -34,7 +34,7 @@ These changes are available on the `master` branch, but have not yet been releas list their accepted parameters. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) - Fixed an issue where the optional parameters of `InteractionResponse.send_message` - were being typed as optional. + weren't type hinted as optional. ([#3061](https://github.com/Pycord-Development/pycord/pull/3061)) ### Deprecated diff --git a/discord/commands/context.py b/discord/commands/context.py index 1ac7c08be7..b9d6f8eff0 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -285,7 +285,6 @@ def send_modal(self) -> Callable[..., Awaitable[Interaction]]: async def respond( self, content: Any | None = None, - *args: Any, embed: Embed | None = None, view: BaseView | None = None, tts: bool = False, @@ -295,14 +294,12 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, - **kwargs: Any, ) -> Interaction | WebhookMessage: ... @overload async def respond( self, content: Any | None = None, - *args: Any, embeds: list[Embed] | None = None, view: BaseView | None = None, tts: bool = False, @@ -312,7 +309,6 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, - **kwargs: Any, ) -> Interaction | WebhookMessage: ... @discord.utils.copy_doc(Interaction.respond) diff --git a/discord/interactions.py b/discord/interactions.py index b2f09addb7..3578ca2f09 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -703,7 +703,6 @@ async def delete_original_message(self, **kwargs): async def respond( self, content: Any | None = None, - *args: Any, embed: Embed | None = None, view: BaseView | None = None, tts: bool = False, @@ -713,14 +712,12 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, - **kwargs: Any, ) -> Interaction | WebhookMessage: ... @overload async def respond( self, content: Any | None = None, - *args: Any, embeds: list[Embed] | None = None, view: BaseView | None = None, tts: bool = False, @@ -730,7 +727,6 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, - **kwargs: Any, ) -> Interaction | WebhookMessage: ... async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: