From 5c609253da320f95e5e1cbb4d7a66c40e98285f4 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Fri, 9 Jan 2026 18:50:27 +0100 Subject: [PATCH 01/32] =?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/32] 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/32] 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/32] 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/32] 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/32] 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/32] 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/32] 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/32] 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/32] =?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/32] 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/32] 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/32] 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 28b161f8516451aab2f75640ef9a1503d95636e8 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Tue, 13 Jan 2026 10:54:16 +0100 Subject: [PATCH 14/32] =?UTF-8?q?=E2=9C=A8=20Add=20new=20parameters=20init?= =?UTF-8?q?ially?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGELOG.md | 3 +++ discord/interactions.py | 22 +++++++++++++++++++++- discord/webhook/async_.py | 14 ++++++++++++++ 3 files changed, 38 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9fea9a573a..b1d735a0e1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,6 +14,9 @@ These changes are available on the `master` branch, but have not yet been releas - Added `.extension` attribute to emojis to get their file extension. ([#3055](https://github.com/Pycord-Development/pycord/pull/3055)) +- Added `silent` and `suppress_embeds` parameters to `ApplicationContext.respond`, + `Interaction.respond` and `InteractionResponse.send_message`. + ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) ### Changed diff --git a/discord/interactions.py b/discord/interactions.py index 3fc7275fb4..63dd7ffbff 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -714,6 +714,8 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, + silent: bool = False, + suppress_embeds: bool = False, **kwargs: Any, ) -> Interaction | WebhookMessage: ... @@ -758,6 +760,14 @@ async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: The poll to send. .. versionadded:: 2.6 + silent: :class:`bool` + Whether the message should trigger push and desktop notifications + + .. versionadded:: 2.8 + suppress_embeds: :class:`bool` + Whether embeds for links will be suppressed from appearing. + + .. versionadded:: 2.8 Returns ------- @@ -1015,6 +1025,8 @@ async def send_message( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, + silent: bool = False, + suppress_embeds: bool = False, ) -> Interaction: """|coro| @@ -1052,6 +1064,14 @@ async def send_message( The poll to send. .. versionadded:: 2.6 + silent: :class:`bool` + Whether the message should trigger push and desktop notifications + + .. versionadded:: 2.8 + suppress_embeds: :class:`bool` + Whether embeds for links will be suppressed from appearing. + + .. versionadded:: 2.8 Returns ------- @@ -1090,7 +1110,7 @@ async def send_message( if content is not None: payload["content"] = str(content) - flags = MessageFlags(ephemeral=ephemeral) + flags = MessageFlags(ephemeral=ephemeral, suppress_notifications=silent, suppress_embeds=suppress_embeds) if view: payload["components"] = view.to_components() diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index c9093f7781..a0c06edfa5 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -648,6 +648,7 @@ def handle_message_parameters( previous_allowed_mentions: AllowedMentions | None = None, suppress: bool = False, thread_name: str | None = None, + silent: bool = False ) -> ExecuteWebhookParameters: if files is not MISSING and file is not MISSING: raise TypeError("Cannot mix file and files keyword arguments.") @@ -671,6 +672,7 @@ def handle_message_parameters( flags = MessageFlags( suppress_embeds=suppress, ephemeral=ephemeral, + suppress_notifications=silent, ) if view is not MISSING: @@ -1706,6 +1708,8 @@ async def send( applied_tags: list[Snowflake] = MISSING, wait: bool = False, delete_after: float = None, + silent: bool = False, + suppress_embeds: bool = False, ) -> WebhookMessage | None: """|coro| @@ -1786,6 +1790,14 @@ async def send( The poll to send. .. versionadded:: 2.6 + silent: :class:`bool` + Whether the message should trigger push and desktop notifications + + .. versionadded:: 2.8 + suppress_embeds: :class:`bool` + Whether embeds for links will be suppressed from appearing. + + .. versionadded:: 2.8 Returns ------- @@ -1872,6 +1884,8 @@ async def send( allowed_mentions=allowed_mentions, previous_allowed_mentions=previous_mentions, thread_name=thread_name, + silent=silent, + suppress=suppress_embeds, ) adapter = async_context.get() thread_id: int | None = None From f4f76b26a1f30997a07af398507e322e12b47973 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:56:57 +0000 Subject: [PATCH 15/32] style(pre-commit): auto fixes from pre-commit.com hooks --- discord/interactions.py | 6 +++++- discord/webhook/async_.py | 2 +- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 63dd7ffbff..1940595b8e 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -1110,7 +1110,11 @@ async def send_message( if content is not None: payload["content"] = str(content) - flags = MessageFlags(ephemeral=ephemeral, suppress_notifications=silent, suppress_embeds=suppress_embeds) + flags = MessageFlags( + ephemeral=ephemeral, + suppress_notifications=silent, + suppress_embeds=suppress_embeds, + ) if view: payload["components"] = view.to_components() diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index a0c06edfa5..cb772649bd 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -648,7 +648,7 @@ def handle_message_parameters( previous_allowed_mentions: AllowedMentions | None = None, suppress: bool = False, thread_name: str | None = None, - silent: bool = False + silent: bool = False, ) -> ExecuteWebhookParameters: if files is not MISSING and file is not MISSING: raise TypeError("Cannot mix file and files keyword arguments.") From aed9ed0aeaf427fcb4766243c5e8bf4afe39fd33 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Tue, 13 Jan 2026 11:35:40 +0100 Subject: [PATCH 16/32] =?UTF-8?q?=F0=9F=93=9D=20Fix=20up=20docs=20a=20bit?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- discord/interactions.py | 5 +++-- discord/webhook/async_.py | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 1940595b8e..a55107468d 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -761,7 +761,8 @@ async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: .. versionadded:: 2.6 silent: :class:`bool` - Whether the message should trigger push and desktop notifications + Whether the message should trigger push and desktop notifications. Does not apply to followups of + deferred interactions, as these never cause notifications. .. versionadded:: 2.8 suppress_embeds: :class:`bool` @@ -1065,7 +1066,7 @@ async def send_message( .. versionadded:: 2.6 silent: :class:`bool` - Whether the message should trigger push and desktop notifications + Whether the message should trigger push and desktop notifications. .. versionadded:: 2.8 suppress_embeds: :class:`bool` diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index cb772649bd..ce186fc96d 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1791,7 +1791,7 @@ async def send( .. versionadded:: 2.6 silent: :class:`bool` - Whether the message should trigger push and desktop notifications + Whether the message should trigger push and desktop notifications. .. versionadded:: 2.8 suppress_embeds: :class:`bool` From deb1611f9cc16956bdd03c2e09b34a62966d2f51 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Wed, 14 Jan 2026 19:34:27 +0100 Subject: [PATCH 17/32] 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 18/32] 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: From 5200e8c2fb524302a41e599368b73d8be4e10ad6 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Wed, 14 Jan 2026 21:14:15 +0100 Subject: [PATCH 19/32] Add suppress kwargs where I forgot them --- discord/commands/context.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/discord/commands/context.py b/discord/commands/context.py index b9d6f8eff0..c815229ca8 100644 --- a/discord/commands/context.py +++ b/discord/commands/context.py @@ -294,6 +294,8 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, + silent: bool = False, + suppress_embeds: bool = False, ) -> Interaction | WebhookMessage: ... @overload @@ -309,6 +311,8 @@ async def respond( files: list[File] | None = None, poll: Poll | None = None, delete_after: float | None = None, + silent: bool = False, + suppress_embeds: bool = False, ) -> Interaction | WebhookMessage: ... @discord.utils.copy_doc(Interaction.respond) From 96336b7c151d8fbcf96daf89e4258918ea9f31e8 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 20:29:53 +0100 Subject: [PATCH 20/32] Add missing docs --- discord/interactions.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/discord/interactions.py b/discord/interactions.py index 435307539a..28d7ddb585 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -771,6 +771,14 @@ async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: The poll to send. .. versionadded:: 2.6 + silent: :class:`Poll` + Whether to suppress push and desktop notifications for the message. + + .. versionadded:: 2.8 + suppress_embeds: :class:`bool` + Whether to suppress embeds for the message. + + .. versionadded:: 2.8 Returns ------- From 1e1b0f61a2086df73e7e4a04f1a38ac8d1de81b1 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 20:31:34 +0100 Subject: [PATCH 21/32] Make doc text equal --- discord/webhook/async_.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index ce186fc96d..3235c6f4a3 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -1791,11 +1791,11 @@ async def send( .. versionadded:: 2.6 silent: :class:`bool` - Whether the message should trigger push and desktop notifications. + Whether to suppress push and desktop notifications for the message. .. versionadded:: 2.8 suppress_embeds: :class:`bool` - Whether embeds for links will be suppressed from appearing. + Whether to suppress embeds for the message. .. versionadded:: 2.8 From 7904484b676b20e8dcd785ea5c5b11ddd0c09df0 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 21:01:57 +0100 Subject: [PATCH 22/32] Fix merge request mistakes --- discord/interactions.py | 32 +++++++++++++++++++++++--------- 1 file changed, 23 insertions(+), 9 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 28d7ddb585..2006dc083c 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -1026,16 +1026,18 @@ 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, + silent: bool = False, + suppress_embeds: bool = False, ) -> Interaction: """|coro| @@ -1073,6 +1075,14 @@ async def send_message( The poll to send. .. versionadded:: 2.6 + silent: :class:`Poll` + Whether to suppress push and desktop notifications for the message. + + .. versionadded:: 2.8 + suppress_embeds: :class:`bool` + Whether to suppress embeds for the message. + + .. versionadded:: 2.8 Returns ------- @@ -1111,7 +1121,11 @@ async def send_message( if content is not None: payload["content"] = str(content) - flags = MessageFlags(ephemeral=ephemeral) + flags = MessageFlags( + ephemeral=ephemeral, + suppress_notifications=silent, + suppress_embeds=suppress_embeds, + ) if view: payload["components"] = view.to_components() From baedbc5945534a0ef296b46c35ac786e4c12d9d6 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 21:11:08 +0100 Subject: [PATCH 23/32] Fix bool / poll mistype --- discord/interactions.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 2006dc083c..f5792fe357 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -771,7 +771,7 @@ async def respond(self, *args, **kwargs) -> Interaction | WebhookMessage: The poll to send. .. versionadded:: 2.6 - silent: :class:`Poll` + silent: :class:`bool` Whether to suppress push and desktop notifications for the message. .. versionadded:: 2.8 @@ -1075,7 +1075,7 @@ async def send_message( The poll to send. .. versionadded:: 2.6 - silent: :class:`Poll` + silent: :class:`bool` Whether to suppress push and desktop notifications for the message. .. versionadded:: 2.8 From 27bb7e115a8e10c0083ec89762f2f06908399288 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 21:30:41 +0100 Subject: [PATCH 24/32] Deprecate old parameter and replace it with new one --- discord/abc.py | 17 ++++++++++++++++- discord/interactions.py | 13 ++++++++++++- discord/message.py | 19 +++++++++++++++++-- discord/webhook/async_.py | 13 +++++++++++-- discord/webhook/sync.py | 14 +++++++++++++- 5 files changed, 69 insertions(+), 7 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index 8185154475..c23579d11a 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -55,6 +55,7 @@ from .role import Role from .scheduled_events import ScheduledEvent from .sticker import GuildSticker, StickerItem +from .utils import warn_deprecated from .voice_client import VoiceClient, VoiceProtocol __all__ = ( @@ -1358,6 +1359,7 @@ async def send( view: BaseView = ..., poll: Poll = ..., suppress: bool = ..., + suppress_embeds: bool = ..., silent: bool = ..., ) -> Message: ... @@ -1379,6 +1381,7 @@ async def send( view: BaseView = ..., poll: Poll = ..., suppress: bool = ..., + suppress_embeds: bool = ..., silent: bool = ..., ) -> Message: ... @@ -1400,6 +1403,7 @@ async def send( view: BaseView = ..., poll: Poll = ..., suppress: bool = ..., + suppress_embeds: bool = ..., silent: bool = ..., ) -> Message: ... @@ -1421,6 +1425,7 @@ async def send( view: BaseView = ..., poll: Poll = ..., suppress: bool = ..., + suppress_embeds: bool = ..., silent: bool = ..., ) -> Message: ... @@ -1443,6 +1448,7 @@ async def send( view=None, poll=None, suppress=None, + suppress_embeds=None, silent=None, ): """|coro| @@ -1521,6 +1527,12 @@ async def send( .. versionadded:: 2.0 suppress: :class:`bool` Whether to suppress embeds for the message. + + .. deprecated:: 2.8 + suppress_embeds: :class:`bool`Expand commentComment on line R778ResolvedCode has comments. Press enter to view. + Whether to suppress embeds for the message. + + .. versionadded:: 2.8 silent: :class:`bool` Whether to suppress push and desktop notifications for the message. @@ -1568,8 +1580,11 @@ async def send( ) embeds = [embed.to_dict() for embed in embeds] + if suppress: + suppress_embeds = suppress + warn_deprecated("suppress", "suppress_embeds", "2.8") flags = MessageFlags( - suppress_embeds=bool(suppress), + suppress_embeds=bool(suppress_embeds), suppress_notifications=bool(silent), ) diff --git a/discord/interactions.py b/discord/interactions.py index f5792fe357..06b14f9a0a 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -47,6 +47,7 @@ from .object import Object from .permissions import Permissions from .user import User +from .utils import warn_deprecated from .webhook.async_ import ( Webhook, WebhookMessage, @@ -526,6 +527,7 @@ async def edit_original_response( allowed_mentions: AllowedMentions | None = None, delete_after: float | None = None, suppress: bool = False, + suppress_embeds: bool = False, ) -> InteractionMessage: """|coro| @@ -567,6 +569,12 @@ async def edit_original_response( suppress: :class:`bool` Whether to suppress embeds for the message. + .. deprecated:: 2.8 + suppress_embeds: :class:`bool` + Whether to suppress embeds for the message. + + .. versionadded:: 2.8 + Returns ------- :class:`InteractionMessage` @@ -585,6 +593,9 @@ async def edit_original_response( """ previous_mentions: AllowedMentions | None = self._state.allowed_mentions + if suppress: + warn_deprecated("suppress", "suppress_embeds", "2.8") + suppress_embeds = suppress params = handle_message_parameters( content=content, file=file, @@ -595,7 +606,7 @@ async def edit_original_response( view=view, allowed_mentions=allowed_mentions, previous_allowed_mentions=previous_mentions, - suppress=suppress, + suppress=suppress_embeds, ) if view and self.message: self._state.prevent_view_updates_for(self.message.id) diff --git a/discord/message.py b/discord/message.py index b59d78c89a..a7d87bb339 100644 --- a/discord/message.py +++ b/discord/message.py @@ -60,7 +60,7 @@ from .reaction import Reaction from .sticker import StickerItem from .threads import Thread -from .utils import MISSING, escape_mentions, find +from .utils import MISSING, escape_mentions, find, warn_deprecated if TYPE_CHECKING: from .abc import ( @@ -1737,6 +1737,7 @@ async def edit( files: list[File] | None = ..., attachments: list[Attachment] = ..., suppress: bool = ..., + suppress_embeds: bool = ..., delete_after: float | None = ..., allowed_mentions: AllowedMentions | None = ..., view: BaseView | None = ..., @@ -1751,6 +1752,7 @@ async def edit( files: list[Sequence[File]] = MISSING, attachments: list[Attachment] = MISSING, suppress: bool = MISSING, + suppress_embeds: bool = MISSING, delete_after: float | None = None, allowed_mentions: AllowedMentions | None = MISSING, view: BaseView | None = MISSING, @@ -1789,6 +1791,15 @@ async def edit( all the embeds if set to ``True``. If set to ``False`` this brings the embeds back if they were suppressed. Using this parameter requires :attr:`~.Permissions.manage_messages`. + + .. deprecated: 2.8 + suppress_embeds: :class:`bool` + Whether to suppress embeds for the message. This removes + all the embeds if set to ``True``. If set to ``False`` + this brings the embeds back if they were suppressed. + Using this parameter requires :attr:`~.Permissions.manage_messages`. + + .. versionadded:: 2.8 delete_after: Optional[:class:`float`] If provided, the number of seconds to wait in the background before deleting the message we just edited. If the deletion fails, @@ -1837,7 +1848,11 @@ async def edit( flags = MessageFlags._from_value(self.flags.value) if suppress is not MISSING: - flags.suppress_embeds = suppress + warn_deprecated("suppress", "suppress_embeds", "2.8") + suppress_embeds = suppress + + if suppress_embeds is not MISSING: + flags.suppress_embeds = suppress_embeds if allowed_mentions is MISSING: if ( diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 3235c6f4a3..b6191fbcb7 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -63,6 +63,8 @@ "PartialWebhookGuild", ) +from ..utils import warn_deprecated + _log = logging.getLogger(__name__) if TYPE_CHECKING: @@ -648,6 +650,7 @@ def handle_message_parameters( previous_allowed_mentions: AllowedMentions | None = None, suppress: bool = False, thread_name: str | None = None, + suppress_embeds: bool = False, silent: bool = False, ) -> ExecuteWebhookParameters: if files is not MISSING and file is not MISSING: @@ -668,9 +671,11 @@ def handle_message_parameters( _attachments = [] if attachments is not MISSING: _attachments = [a.to_dict() for a in attachments] - + if suppress: + suppress_embeds = True + warn_deprecated("suppress", "suppress_embeds", "2.8") flags = MessageFlags( - suppress_embeds=suppress, + suppress_embeds=suppress_embeds, ephemeral=ephemeral, suppress_notifications=silent, ) @@ -1663,6 +1668,8 @@ async def send( applied_tags: list[Snowflake] = MISSING, wait: Literal[True], delete_after: float = None, + silent: bool = False, + suppress_embeds: bool = False, ) -> WebhookMessage: ... @overload @@ -1686,6 +1693,8 @@ async def send( applied_tags: list[Snowflake] = MISSING, wait: Literal[False] = ..., delete_after: float = None, + silent: bool = False, + suppress_embeds: bool = False, ) -> None: ... async def send( diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index fde7031321..d58c767cde 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -60,6 +60,8 @@ "SyncWebhookMessage", ) +from ..utils import warn_deprecated + _log = logging.getLogger(__name__) if TYPE_CHECKING: @@ -469,6 +471,7 @@ def edit( files: list[File] = MISSING, allowed_mentions: AllowedMentions | None = None, suppress: bool | None = MISSING, + suppress_embeds: bool | None = MISSING, ) -> SyncWebhookMessage: """Edits the message. @@ -492,6 +495,12 @@ def edit( suppress: Optional[:class:`bool`] Whether to suppress embeds for the message. + .. deprecated:: 2.8 + suppress_embeds: Optional[:class:`bool`] + Whether to suppress embeds for the message. + + .. versionadded:: 2.8 + Returns ------- :class:`SyncWebhookMessage` @@ -519,6 +528,9 @@ def edit( if suppress is MISSING: suppress = self.flags.suppress_embeds + if suppress is not MISSING: + warn_deprecated("suppress", "suppress_embeds", "2.8") + suppress_embeds = suppress return self._state._webhook.edit_message( self.id, content=content, @@ -528,7 +540,7 @@ def edit( files=files, allowed_mentions=allowed_mentions, thread=thread, - suppress=suppress, + suppress=suppress_embeds, ) def delete(self, *, delay: float | None = None) -> None: From 9f381241403f4d17ccece2a1cc04abbd3e1511fd Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 21:32:37 +0100 Subject: [PATCH 25/32] Update changelog --- CHANGELOG.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68d17bd19a..2eb45ee27f 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -48,6 +48,10 @@ These changes are available on the `master` branch, but have not yet been releas ### Deprecated +- Deprecated `suppress`-parameter in all applicable message-related methods. Does not + affect any functions related to voice. + ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) + ### Removed - Removed guild creation and ownership related methods and arguments as they're not From 7d75f2d019662a172a5385e4d56bd1b3e9ecfb78 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 21:49:39 +0100 Subject: [PATCH 26/32] Apply code change requests --- discord/abc.py | 6 ++++-- discord/message.py | 3 ++- discord/webhook/async_.py | 6 +++--- discord/webhook/sync.py | 10 ++++++---- 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/discord/abc.py b/discord/abc.py index c23579d11a..920e955296 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1580,9 +1580,11 @@ async def send( ) embeds = [embed.to_dict() for embed in embeds] - if suppress: - suppress_embeds = suppress + if suppress is not None: warn_deprecated("suppress", "suppress_embeds", "2.8") + if suppress_embeds is None: + suppress_embeds = suppress + flags = MessageFlags( suppress_embeds=bool(suppress_embeds), suppress_notifications=bool(silent), diff --git a/discord/message.py b/discord/message.py index a7d87bb339..5f6ae277a0 100644 --- a/discord/message.py +++ b/discord/message.py @@ -1849,7 +1849,8 @@ async def edit( if suppress is not MISSING: warn_deprecated("suppress", "suppress_embeds", "2.8") - suppress_embeds = suppress + if suppress_embeds is MISSING: + suppress_embeds = suppress if suppress_embeds is not MISSING: flags.suppress_embeds = suppress_embeds diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index b6191fbcb7..097827680f 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -648,7 +648,7 @@ def handle_message_parameters( applied_tags: list[Snowflake] = MISSING, allowed_mentions: AllowedMentions | None = MISSING, previous_allowed_mentions: AllowedMentions | None = None, - suppress: bool = False, + suppress: bool | None = None, thread_name: str | None = None, suppress_embeds: bool = False, silent: bool = False, @@ -671,8 +671,8 @@ def handle_message_parameters( _attachments = [] if attachments is not MISSING: _attachments = [a.to_dict() for a in attachments] - if suppress: - suppress_embeds = True + if suppress is not None: + suppress_embeds = suppress warn_deprecated("suppress", "suppress_embeds", "2.8") flags = MessageFlags( suppress_embeds=suppress_embeds, diff --git a/discord/webhook/sync.py b/discord/webhook/sync.py index d58c767cde..99b142e0bf 100644 --- a/discord/webhook/sync.py +++ b/discord/webhook/sync.py @@ -525,12 +525,14 @@ def edit( elif isinstance(self.channel, Thread): thread = Object(self.channel.id) - if suppress is MISSING: - suppress = self.flags.suppress_embeds - if suppress is not MISSING: warn_deprecated("suppress", "suppress_embeds", "2.8") - suppress_embeds = suppress + if suppress_embeds is MISSING: + suppress_embeds = suppress + + if suppress_embeds is MISSING: + suppress_embeds = self.flags.suppress_embeds + return self._state._webhook.edit_message( self.id, content=content, From 26287e487ad53b32e6797fcb454a09152f48e590 Mon Sep 17 00:00:00 2001 From: ToothyDev <55001472+ToothyDev@users.noreply.github.com> Date: Sun, 25 Jan 2026 22:45:19 +0100 Subject: [PATCH 27/32] Apply suggestions from code review Co-authored-by: Paillat Signed-off-by: ToothyDev <55001472+ToothyDev@users.noreply.github.com> --- discord/interactions.py | 11 +++++++---- discord/webhook/async_.py | 7 +++++-- 2 files changed, 12 insertions(+), 6 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index 06b14f9a0a..f7c973177d 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -526,8 +526,8 @@ async def edit_original_response( view: BaseView | None = MISSING, allowed_mentions: AllowedMentions | None = None, delete_after: float | None = None, - suppress: bool = False, - suppress_embeds: bool = False, + suppress: bool | None = None, + suppress_embeds: bool = None, ) -> InteractionMessage: """|coro| @@ -593,9 +593,12 @@ async def edit_original_response( """ previous_mentions: AllowedMentions | None = self._state.allowed_mentions - if suppress: + if suppress is not None: warn_deprecated("suppress", "suppress_embeds", "2.8") - suppress_embeds = suppress + if suppress_embeds is None: + suppress_embeds = suppress + elif suppress_embeds is None: + suppress_embeds = False params = handle_message_parameters( content=content, file=file, diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 097827680f..75af59416b 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -650,7 +650,7 @@ def handle_message_parameters( previous_allowed_mentions: AllowedMentions | None = None, suppress: bool | None = None, thread_name: str | None = None, - suppress_embeds: bool = False, + suppress_embeds: bool = None, silent: bool = False, ) -> ExecuteWebhookParameters: if files is not MISSING and file is not MISSING: @@ -672,8 +672,11 @@ def handle_message_parameters( if attachments is not MISSING: _attachments = [a.to_dict() for a in attachments] if suppress is not None: - suppress_embeds = suppress warn_deprecated("suppress", "suppress_embeds", "2.8") + if suppress_embeds is None: + suppress_embeds = suppress + elif suppress_embeds is None: + suppress_embeds = False flags = MessageFlags( suppress_embeds=suppress_embeds, ephemeral=ephemeral, From 1f3f4a4e62f686dfbeb63a04150166d279c9f89c Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 22:48:18 +0100 Subject: [PATCH 28/32] Fix intendation --- discord/interactions.py | 6 +++--- discord/webhook/async_.py | 6 +++--- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/discord/interactions.py b/discord/interactions.py index f7c973177d..ceff153b14 100644 --- a/discord/interactions.py +++ b/discord/interactions.py @@ -596,9 +596,9 @@ async def edit_original_response( if suppress is not None: warn_deprecated("suppress", "suppress_embeds", "2.8") if suppress_embeds is None: - suppress_embeds = suppress - elif suppress_embeds is None: - suppress_embeds = False + suppress_embeds = suppress + elif suppress_embeds is None: + suppress_embeds = False params = handle_message_parameters( content=content, file=file, diff --git a/discord/webhook/async_.py b/discord/webhook/async_.py index 75af59416b..d7f9260289 100644 --- a/discord/webhook/async_.py +++ b/discord/webhook/async_.py @@ -674,9 +674,9 @@ def handle_message_parameters( if suppress is not None: warn_deprecated("suppress", "suppress_embeds", "2.8") if suppress_embeds is None: - suppress_embeds = suppress - elif suppress_embeds is None: - suppress_embeds = False + suppress_embeds = suppress + elif suppress_embeds is None: + suppress_embeds = False flags = MessageFlags( suppress_embeds=suppress_embeds, ephemeral=ephemeral, From fd55987df34838479b326962a62e39dd4707bed3 Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Sun, 25 Jan 2026 22:53:03 +0100 Subject: [PATCH 29/32] oops --- discord/abc.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/abc.py b/discord/abc.py index 920e955296..e9e8ea7cd9 100644 --- a/discord/abc.py +++ b/discord/abc.py @@ -1529,7 +1529,7 @@ async def send( Whether to suppress embeds for the message. .. deprecated:: 2.8 - suppress_embeds: :class:`bool`Expand commentComment on line R778ResolvedCode has comments. Press enter to view. + suppress_embeds: :class:`bool` Whether to suppress embeds for the message. .. versionadded:: 2.8 From 70878d6ebb95d1347119afb374a552f6e655a04c Mon Sep 17 00:00:00 2001 From: ToothyDev Date: Mon, 26 Jan 2026 16:50:05 +0100 Subject: [PATCH 30/32] Make changelog more wordy but more correct --- CHANGELOG.md | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2eb45ee27f..731919feb2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -14,8 +14,13 @@ These changes are available on the `master` branch, but have not yet been releas - Added `.extension` attribute to emojis to get their file extension. ([#3055](https://github.com/Pycord-Development/pycord/pull/3055)) -- Added `silent` and `suppress_embeds` parameters to `ApplicationContext.respond`, - `Interaction.respond` and `InteractionResponse.send_message`. +- Added `silent` parameter to all methods that send messages, including + `ApplicationContext.respond`, `Interaction.respond` and + `InteractionResponse.send_message`. + ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) +- Added `suppress_embeds` parameter to all methods that send messages, replacing the + deprecated `suppress`, including `ApplicationContext.respond`, `Interaction.respond` + and `InteractionResponse.send_message`. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) ### Changed From 625ff7806958e2b4d8da79d5e02fa3000d01ecdd Mon Sep 17 00:00:00 2001 From: ToothyDev <55001472+ToothyDev@users.noreply.github.com> Date: Mon, 26 Jan 2026 22:05:21 +0100 Subject: [PATCH 31/32] Apply suggestions from code review Co-authored-by: Paillat Signed-off-by: ToothyDev <55001472+ToothyDev@users.noreply.github.com> --- CHANGELOG.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d89b1bd9be..d1b39efa70 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,7 @@ These changes are available on the `master` branch, but have not yet been releas `ApplicationContext.respond`, `Interaction.respond` and `InteractionResponse.send_message`. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) -- Added `suppress_embeds` parameter to all methods that send messages, replacing the - deprecated `suppress`, including `ApplicationContext.respond`, `Interaction.respond` +- Added `suppress_embeds` parameter to all methods that send messages, replacing `suppress`, including `ApplicationContext.respond`, `Interaction.respond` and `InteractionResponse.send_message`. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) @@ -53,7 +52,7 @@ These changes are available on the `master` branch, but have not yet been releas ### Deprecated -- Deprecated `suppress`-parameter in all applicable message-related methods. Does not +- Deprecated the `suppress` parameter in all applicable message-related methods. Does not affect any functions related to voice. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) From 1a3f3cb05f9c731928da620f5c09d085f4e3a49e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Mon, 26 Jan 2026 21:05:50 +0000 Subject: [PATCH 32/32] style(pre-commit): auto fixes from pre-commit.com hooks --- CHANGELOG.md | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index d1b39efa70..d03dca3a40 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -18,8 +18,9 @@ These changes are available on the `master` branch, but have not yet been releas `ApplicationContext.respond`, `Interaction.respond` and `InteractionResponse.send_message`. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) -- Added `suppress_embeds` parameter to all methods that send messages, replacing `suppress`, including `ApplicationContext.respond`, `Interaction.respond` - and `InteractionResponse.send_message`. +- Added `suppress_embeds` parameter to all methods that send messages, replacing + `suppress`, including `ApplicationContext.respond`, `Interaction.respond` and + `InteractionResponse.send_message`. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) ### Changed @@ -52,8 +53,8 @@ These changes are available on the `master` branch, but have not yet been releas ### Deprecated -- Deprecated the `suppress` parameter in all applicable message-related methods. Does not - affect any functions related to voice. +- Deprecated the `suppress` parameter in all applicable message-related methods. Does + not affect any functions related to voice. ([#3062](https://github.com/Pycord-Development/pycord/pull/3062)) ### Removed